I have query that is returning the follwing data:
Number WeekNumber Date
1111 23 9/11/12 11:01 AM
1111 23 9/11/12 11:58 AM
2222 24 9/17/12 10:14 AM
2222 24 9/18/12 9:52 AM
2222 24 9/19/12 9:46 AM
2222 24 9/20/12 9:42 AM
However what I want is to get the latest date for each week, the result should be:
Number WeekNumber Date
1111 23 9/11/12 11:58 AM
2222 24 9/20/12 9:42 AM
What could I use to obtain this. I have tried to use MAX(DATE) but what I am obtaining is the latest date, not the latest date for each week. I have tried with distinct too but I couldn't make it work with the WHERE clause.
Thank you very much.