Hello, I've tried to modify SQL code for the query PayeeswithBalanceQ, in order to form a pass through query. the code is: SELECT CCur(Nz(DSum("Balance","BillsWithPaymentsQ","PayeeID=" & [PayeeID]),0)) AS TotalBalance, CCur(Nz(DSum("Balance","BillsWithPaymentsQ","PayeeID=" & [PayeeID] & " AND DueDate < #" & Date() & "#"),0)) AS PastDueBalance, DMax("BillDate","BillT","PayeeID=" & [PayeeID]) AS LastBill, DMax("PaymentDate","PaymentsByPayeeQ","PayeeID=" & [PayeeID]) AS LastPayment, PayeeT.* FROM PayeeT; I GET THE ERROR MESSAGE 'THE SUM FUNCTION REQUIRES 1 ARGUEMENT (#174). Can you help me with this one? Thank you very much, in advance.
It's difficult to tell because by itself that SQL is almost meaningless to me. However, if this is for a pass-thru query to SQL Server, then your dates should be enclosed in single quotes '1/1/2000' and not #1/1/2000# like Access uses.
Despina KarayanniOP
@Reply 5 years ago
Thank you for your answer. Actually, I modified the Query in an aggregate query. And it worked fine!
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access SQL Server Lessons.