bopritchard
Programmer
table1
ID CompanyID Date
1 123 1/1/2003
2 123 1/1/2004
3 456 2/1/2003
4 123 1/1/2005
5 456 2/1/2004
My result set should look like this
CompanyID Date PreviousDate
123 1/1/2005 1/1/2004
456 2/1/2004 2/1/2003
Logic is this:
only the MOST recent(by Date) record PER companyID should be shown...and the date from the 2nd MOST recent(by Date) record should be appened to the record as PreviousDate column
ID CompanyID Date
1 123 1/1/2003
2 123 1/1/2004
3 456 2/1/2003
4 123 1/1/2005
5 456 2/1/2004
My result set should look like this
CompanyID Date PreviousDate
123 1/1/2005 1/1/2004
456 2/1/2004 2/1/2003
Logic is this:
only the MOST recent(by Date) record PER companyID should be shown...and the date from the 2nd MOST recent(by Date) record should be appened to the record as PreviousDate column