query output problem

P

Paul

Hello There, I am trying to get this query to work but have hit a road
block....see below

'Sample - RecyHistory Table Data:

DateRec PalletCount
12/1/08 2
12/1/08 3
12/8/08 5
12/15/08 2
12/15/08 6

'Query to get average number of pallets received for each day of the week

SELECT DatePart("w",RecyHistory.DateRec) AS DayOfTheWeek,
Sum(RecyHistory.PalletCount) AS PalletCountTotal,
Avg(RecyHistory.PalletCount) AS PalletCountAverage
FROM RecyHistory
GROUP BY DatePart("w",RecyHistory.DateRec);

' Output of the above Query:

DayOfWeek PalletCountTotal PalletCountAverage
2 18 3.6

*********************************************************************************************
' What I am looking for:

DayOfWeek PalletCountTotal PalletCountAverage
2 18 6

' Dates should be "unique", and the pallet Count should be summed
accordingly, ie:

12/1/08 3 + 2 =5
12/8/08 =5
12/15/08 2 + 6 =8


Thank you,
Paul
 
J

Jeff Boyce

Paul

Already responded to in another newsgroup. Please don't post the same
question to multiple newsgroups ... instead, post a question and in the
"To:"/"Newsgroups:" field select the most appropriate newsgroup(s). It is
rarely necessary to post to more than one.

Regards

Jeff Boyce
Microsoft Office/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