summing duplicate data (<--help a rookie please)

D

Dan

Hello -

I have a table which looks like the following:

PLU ITEM DATE SOLD
12345 BALL 3/7/08 6
56789 ROPE 3/7/08 8
12345 BALL 3/14/08 2
12345 BALL 3/14/08 9
67900 GAME 3/14/08 4

I am trying to create a query which will summarize each week, plu,
sold; like this:

PLU ITEM DATE SOLD
12345 BALL 3/7/08 6
56789 ROPE 3/7/08 8
12345 BALL 3/14/08 11
67900 GAME 3/14/08 4

However, I can't figure out how to SUM the SOLD column when the DATE
is the same. The example above shows PLU 12345 on 3/14/08.

Any suggestions? Thanks!
Dan
 
M

MGFoster

Dan said:
Hello -

I have a table which looks like the following:

PLU ITEM DATE SOLD
12345 BALL 3/7/08 6
56789 ROPE 3/7/08 8
12345 BALL 3/14/08 2
12345 BALL 3/14/08 9
67900 GAME 3/14/08 4

I am trying to create a query which will summarize each week, plu,
sold; like this:

PLU ITEM DATE SOLD
12345 BALL 3/7/08 6
56789 ROPE 3/7/08 8
12345 BALL 3/14/08 11
67900 GAME 3/14/08 4

However, I can't figure out how to SUM the SOLD column when the DATE
is the same. The example above shows PLU 12345 on 3/14/08.

SELECT PLU, Item, [date], Sum(Sold) As TotSold
FROM table_name
GROUP BY PLU, Item, [date]
 

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