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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

This sql statement is giving me an 2

Status
Not open for further replies.

MikeT

IS-IT--Management
Feb 1, 2001
376
US
This sql statement is giving me an error that goes something like "You tried to execute a query that does not include the specified expression 'field3' as part of an aggregate function."
Anybody?

SELECT SUM([field1]) AS ttlVolume,
SUM([field2]) AS ttlUnits,
field3,field4
FROM [myTable] WHERE [Date] = #3/10/2001#


Thanks
 
SELECT field3,field4, SUM([field1]) AS ttlVolume,
SUM([field2]) AS ttlUnits
FROM [myTable] WHERE [Date] = #3/10/2001#
GROUP BY field3,field4


That should work.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top