Link to home
Start Free TrialLog in
Avatar of TadSter
TadSter

asked on

SQL Query; most recent status for each date

I don't know where to start with this.

I need a query to return the most recent status for a given client. Using SQL Server2008. There are multiple dates and multiple statuses.

The status field can include any number of statuses.  I don't know what will be in that field. The query should generate a list of the existing statuses for the given client and then get the most recent date for each status.

@ClientNum = '6000'

ClientNum      Date      Status
6000      06/14/10           Started
6000      06/24/10           Process1
6000      07/04/10           Process2
6000      07/14/10           Finished

Can you help me??
ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TadSter
TadSter

ASKER

Ouch! I thought this was going to be hard...