Dear Friends
I have a table as below.
PCode…………Status………..StatusDate
001.....………….3…………….1/1/2009
001.....………….1…………….2/1/2009
001.....………….2…………….3/1/2009
002.....………….1…………….1/3/2009
002.....………….2…………….2/3/2009
002.....………….3…………….3/3/2009
I want the query to run as followed.
PCode…………Status………..StatusDate
001....………….1…………….2/1/2009
002....………….1…………….1/3/2009
Although it is convenient to find the "Status" value by "min" function, I don't know how to make the "StatusDate" of respective row appear.
Please help me.
I have a table as below.
PCode…………Status………..StatusDate
001.....………….3…………….1/1/2009
001.....………….1…………….2/1/2009
001.....………….2…………….3/1/2009
002.....………….1…………….1/3/2009
002.....………….2…………….2/3/2009
002.....………….3…………….3/3/2009
I want the query to run as followed.
PCode…………Status………..StatusDate
001....………….1…………….2/1/2009
002....………….1…………….1/3/2009
Although it is convenient to find the "Status" value by "min" function, I don't know how to make the "StatusDate" of respective row appear.
Please help me.