M
Marcie
I have the following information in a table:
id record amount date
1001 0 100 12/31/2009
1001 1 150 12/31/2009
1001 0 100 11/31/2009
1001 1 150 11/31/2009
1002 0 75 12/31/2009
1002 0 125 11/31/2009
I want the max date by id and record and sum amount so i want
1001 250 12/31/2009
1002 75 12/31/2009
Right now I am doing it in 2 queries I first find max then second query sums
it because if I try to sum it in the first one I actually get all amounts
id record amount date
1001 0 100 12/31/2009
1001 1 150 12/31/2009
1001 0 100 11/31/2009
1001 1 150 11/31/2009
1002 0 75 12/31/2009
1002 0 125 11/31/2009
I want the max date by id and record and sum amount so i want
1001 250 12/31/2009
1002 75 12/31/2009
Right now I am doing it in 2 queries I first find max then second query sums
it because if I try to sum it in the first one I actually get all amounts