syntax of call in my query?

L

lpj

what is the correct way to put a call in my query (this
global variable value is the 'having' clause). Thanks!
without the call i have no problems but then when i add
the call i get an error msg about 'amount' not being in my
aggregate function... i know it's my syntax.. but how do i
fix it? thanks! here is my query (i'm not including the
entire query.. it's on another laptop.. and too much to
type.. im starting with the 'group by')



GROUP BY tblRefunds.Company, tblRefunds.ID,
tblRefunds.Date, tblRefunds.TaxType,
tblRfundAmtsToAccts.GLAccountNo,
tblRfundsAmtsToAccts.Amount=getglobal(mysql)

ORDER BY tblRefunds.TaxType Desc;
 
T

Tom Ellison

Dear lp:

The GROUP BY clause will not have any criteria. First, eliminate the
"=getglobal(mysql)" part and see if this eliminates the syntactical problem.

If you need to filter tblRfundsAmtsToAccts.Amount, then this would be done
in the WHERE clause of the query or perhaps in a HAVING clause, but not in
the GROUP BY clause. Once you have the rest of the query working, you can
try adding that.

Where does the query get the value of "mysql"? Is this a column in one of
the tables or queries in the FROM clause? I wonder this because, unlike all
the other columns you show in the query fragment, this is not fully
qualified. If the query is to pass the value of this to the function, then
it has to be some value to which the query has access, namely a column in
one of the tables or queries declared in the FROM clause.

Hope this helps, or at least gets us started toward some solution.

Tom Ellison
Microsoft Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top