If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
summing duplicate data (--help a rookie please)
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 |
#2
|
|||
|
|||
summing duplicate data (--help a rookie please)
Dan wrote:
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] -- MGFoster:::mgf00 at earthlink decimal-point net Oakland, CA (USA) ** Respond only to this newsgroup. I DO NOT respond to emails ** |
Thread Tools | |
Display Modes | |
|
|