Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Starting to hate SQL

Author  Topic 

MikeB
Constraint Violating Yak Guru

387 Posts

Posted - 2002-07-04 : 10:45:02
I am trying to group by ShippingDate, ProjectNumber, LoadNumber, Stack, Level in the following SQL Statement:

csSelect.Format("SELECT ShippingLoadTable.ShippingDate,
ShippingLoadTable.ProjectNumber,
ShippingLoadTable.LoadNumber,
ShippingLoadTable.MarkNumber,
[ShippingLoadTable.Stack],
[ShippingLoadTable.Level],
[ShippingLoadTable.Position]
FROM ShippingLoadTable WHERE ShippingLoadTable.ShippingDate = #%s#
AND ProjectNumber = '%s'
GROUP BY ShippingLoadTable.ShippingDate,
ShippingLoadTable.ProjectNumber,
ShippingLoadTable.LoadNumber,
ShippingLoadTable.Stack,
ShippingLoadTable.Level",
csDate, m_csProjectNumber);


I get the following error:

"You tried to execute a query that does not include the specified expression 'LoadNumber' as part of an aggregate function." (1)}

What does this mean?

Mike B




Edited by - MikeB on 07/04/2002 10:48:24

Edited by - MikeB on 07/04/2002 10:49:04

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2002-07-04 : 10:55:18
As I said in the other post, you have to include all the values in your Select list in a Group by....

Peace

Rick

Go to Top of Page

MikeB
Constraint Violating Yak Guru

387 Posts

Posted - 2002-07-04 : 11:11:37
Thank you! Sorry about that, must have overlooked in frusteration!

Mike B

Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2002-07-04 : 11:37:24
No problem.. It's annoying to be stuck on something you think should be simple is one of the most frustrating things in the IT profession...

Peace

Rick

Go to Top of Page
   

- Advertisement -