I need some help on this: I want the records that have the greatest dates per month regardless of the other data in the columns.
Table:
Comp_sk Prod_dt Ddown_rsn Ddown_hrs
1 2/2/2001 rr 15
2 1/5/2001 er 48
2 2/5/2001 ik 25
2 2/18/2001 ip 36
3 1/13/2001 rr 25
3 2/15/2001 ee 25
3 2/28/2001 ew 22
3 3/5/25/2001 ww 55
3 3/31/2001 ee 44
So, I need a query that would return:
1 2/2/2001 rr 15
2 1/5/2001 er 48
2 2/18/2001 ip 36
3 1/13/2001 rr 25
3 2/28/2001 ew 22
3 3/31/2001 ee 44
The results need to include the greatest date per month.
Table:
Comp_sk Prod_dt Ddown_rsn Ddown_hrs
1 2/2/2001 rr 15
2 1/5/2001 er 48
2 2/5/2001 ik 25
2 2/18/2001 ip 36
3 1/13/2001 rr 25
3 2/15/2001 ee 25
3 2/28/2001 ew 22
3 3/5/25/2001 ww 55
3 3/31/2001 ee 44
So, I need a query that would return:
1 2/2/2001 rr 15
2 1/5/2001 er 48
2 2/18/2001 ip 36
3 1/13/2001 rr 25
3 2/28/2001 ew 22
3 3/31/2001 ee 44
The results need to include the greatest date per month.