Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Totals query not working

Status
Not open for further replies.

din2005

Programmer
Mar 22, 2005
162
GB
I'm trying to do totals query where it adds the prices in the inclVAT. This works but soon as i have a criteria between certain dates i get this error message...

"You tried to execute a query that does not include the specified expression tblpreorder.reqdate Between #1/1/2002 and #31/12/2002# as part of the aggregate funciton"

SELECT tblPreOrder.FinanceCode, Sum(tblPreOrder.IncLVAT) AS SumOfIncLVAT
FROM tblPreOrder
GROUP BY tblPreOrder.FinanceCode
HAVING (((tblPreOrder.ReqDate) Between #1/1/2002# And #31/12/2002#));


Is there anyway of solving this one or trying to do it a different way???

 
SELECT FinanceCode, Sum(IncLVAT) AS SumOfIncLVAT
FROM tblPreOrder
WHERE ReqDate Between #2002-01-01# And #2002-12-31#
GROUP BY FinanceCode

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top