Can someone clue me in for an SQL or efficient way to extract detail records and place them along a horizontal continuum for a report? I have to do calculations on multiple review_dates and time elapsed between each review. right now it's in a table like such: The dates have to go from farthest away to recent on report and only the latest 4 detail records; over time there could be dozens per client.
client review_date
1 10/25/2005
1 11/15/2005
1 12/2/2005
2 9/16/2005
2 9/28/2005
etc.
The report, however, has to look like this:
btwn1&2 btwn2&3
Client Reviewdate1 Reviewdate2 diff ReviewDate3 diff
1 10/25/2005 11/15/2005 26 12/2/2005 17
thanks for any guidance out there!
client review_date
1 10/25/2005
1 11/15/2005
1 12/2/2005
2 9/16/2005
2 9/28/2005
etc.
The report, however, has to look like this:
btwn1&2 btwn2&3
Client Reviewdate1 Reviewdate2 diff ReviewDate3 diff
1 10/25/2005 11/15/2005 26 12/2/2005 17
thanks for any guidance out there!