![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
I have a simple table that contains Item codes, qty units, prices and proce dates as follows: ItemA, 1, 7.75, 2003/08/03 ItemA, 2, 9.22, 2003/08/04 ItemA, 5, 7.25, 2003/08/02 ItemA, 4, 8.25, 2003/08/01 ItemB, 3, 3.35, 2003/08/03 ItemB, 9, 3.25, 2003/08/05 ItemC, 3, 0.98, 2003/08/07 ItemC, 7, 0.78, 2003/08/03 ItemC, 4, 0.48, 2003/08/02 etc.. I am trying to write a query that will return one line per item ( GROUP BY Item ) with the sum of units for each group and the price of the MAX date for each group. ex: For the above the result should be be: ItemA, 12.00, 9.22 ItemB, 12.00, 3.25 ItemC, 14.00, 0.98 Thanks. |
![]() |
| Thread Tools | |
| Display Modes | |
| |