Re: Query Problem - Query works in Query window but not as code in a f

Tech-Archive recommends: Speed Up your PC by fixing your registry



The " []. " notation for SubQuery / SubSQL always gets me as well. I am
reasonable with SQL but I have never been able to use this notation.

Luckily, the parentheses seem to work for me. Try replacing " [...]. " with
just "( ...)" without the dot after.

HTH
Van T. Dinh
MVP (Access)



"PatT123" <PatT123@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0F5E4019-82ED-41F2-9D73-AB20FD08EBC1@xxxxxxxxxxxxxxxx
> This Query will work as QUERY6 in the form and in the query window, but
when
> I take the code and put it into the record source of a form I get a syntax
> error in from clause. I tried the sub query with and without (). Same
> result. Can someone help?
>
>
> SELECT TBLFUNDINGTOPOS.PosNo, TBLFUNDING.Funding, TBLFUNDING.PCA,
> TBLPCA.Fund, TBLFUNDING.FedGrant_PH, TBLFUNDING.OthGrant_PH,
> TBLFUNDINGTOPOS.Percent, TBLPCA.SubProgram, TBLFUNDINGTOPOS.TotalFTE,
> CurrFTE.SumOfPercent
> FROM (TBLIndex RIGHT JOIN TBLPosition ON TBLIndex.Index =
TBLPosition.Index)
> RIGHT JOIN ((TBLFunds RIGHT JOIN TBLPCA ON TBLFunds.FUND = TBLPCA.Fund)
RIGHT
> JOIN (TBLFUNDING RIGHT JOIN (TBLFUNDINGTOPOS LEFT JOIN ([SELECT
> Sum(TBLFundingToPos.Percent) AS SumOfPercent, TBLFundingToPos.DIVFund
> FROM TBLFundingToPos
> GROUP BY TBLFundingToPos.DIVFund]. AS CurrFTE) ON TBLFUNDINGTOPOS.DIVFund
=
> CurrFTE.DIVFund) ON TBLFUNDING.Funding = TBLFUNDINGTOPOS.Funding) ON
> TBLPCA.PCA = TBLFUNDING.PCA) ON TBLPosition.PosNo = TBLFUNDINGTOPOS.PosNo;


.



Relevant Pages

  • Multiple Sub Queries Coded for use in a main Query
    ... Would it be possible if I cannot use a sub query within a query ... I would rather put the queries ... contain any *further brackets* within it. ... ((TBLFunds ...
    (microsoft.public.access.queries)
  • Re: Problem with a query that has multiple queries in it.
    ... contain any *further brackets* within it. ... SQL of qry1 in your full query as a "virtual table" ... ((TBLFunds ...
    (microsoft.public.access.queries)
  • Query Problem - Query works in Query window but not as code in a f
    ... This Query will work as QUERY6 in the form and in the query window, ... I take the code and put it into the record source of a form I get a syntax ... RIGHT JOIN ((TBLFunds RIGHT JOIN TBLPCA ON TBLFunds.FUND = TBLPCA.Fund) RIGHT ...
    (microsoft.public.access.queries)
  • Re: Query by form
    ... I am now running a chain of 6 queries on queries from a form. ... query window. ... queries without having the query windows pop open. ... Set the following properties for the gender combobox as follows. ...
    (comp.databases.ms-access)
  • Re: Select Into -Issue , Please help
    ... It is a matter of the scope of the temporary table. ... In the query window, once you have created #tmp_table1 in that window, it will exist until you get rid of it. ... But if i use the same from the VB6 GUI, ...
    (microsoft.public.sqlserver.clients)