keyongtech


  keyongtech > access.* > access.queries > 08/2005

 #1  
08-24-05, 08:26 PM
PatT123
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;
 #2  
08-25-05, 04:18 AM
Van T. Dinh
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> wrote in message
news:ebc1
[..]
 #3  
08-25-05, 04:16 PM
PatT123
Sorry I am new to discussion groups. I did try changing the [] with () and
removing the . however Access seems to be changing the code when I save the
query. Even with the () it changes fields to brackets and will not run as a
code in the record source of the form. The only thing I can think to do at
this time is to put the query into a module and update the record source on
open.

Thanks again.

"Van T. Dinh" wrote:
[..]
Similar Threads
Query works in Query Analizer but not as part of a table adapter

I'm trying to run a query to return all of the customers who have not placed an order. This query runs fine in Query Analizer but when I try to run it as part of a table...

ADP code hangs while running the same query in query analyser works

I have got an updateable snapshot based on a view. When close the form, it automatically sends out the following script to update the underlying table. exec sp_executesql...

Error running query for report...but query works fine when opened separately

We have a legacy access application with a parameterized query, its single parameter being a date. The query runs without problem. A report, based on this query, receives the...

Query works in SQL Query Analyzer but doesn't work in DTS

I am trying to insert records to a table in a database if the records are not existed in the table already. The source data is from a table in another database. My query...

BCP query out executed by xp_cmdshell works fine from query analyzer but fails from VB Component

Hi all, I have a stored procedure which returns a vast number of record and i have to write the output into a csv file. I'm using BCP utility to do this and BCP utility is...


All times are GMT. The time now is 12:06 PM. | Privacy Policy