Here is my problem I have a table that has two measures, for one measure I need to sum everything in that field for the other measure I need to find the max date a combination of 2 fields.
Here is how the table looks and what I need
date1 date2 amt1 amt2
20020522 20020619 45.60 45.60 x
20020522 20020619 43.49 43.49 x
20020522 20070921 11.83 9.69
20020522 20071107 11.83 -9.69
20020522 20080215 11.83 0.00 x
total 100.92 89.09
I need to sum all of the amounts in the amt2 column, and I only need the max dates in the amt1 column (see x for the ones I need). Not sure how to do this one and I need the detail to show for amt2 is it doable? I am currently using Microsoft SQL 2008 R2.
Antonio