For one singe item in the database I could have multiple dates that it has appeared in the database(see below).
Record Barcode Date
1 123 3/25/2005
2 123 3/24/2004
3 123 11/12/2003
4 345 3/25/2005
5 345 3/24/2004
6 345 11/12/2003
I am trying to take this format and convert it to the following:
Record Barcode Date LastDate
1 123 3/25/2005 3/24/2004
2 123 3/24/2004 11/12/2003
3 123 11/12/2003 NULL
4 345 3/25/2005 3/24/2004
5 345 3/24/2004 11/12/2003
6 345 11/12/2003 NULL
So far I have managed to pull the max(date) and place it in every record for lastdate. I also managed to take the max(date) for each barcode and place it in the lastdate for the records with the same barcode. Any sort of help would be appreciated.
Record Barcode Date
1 123 3/25/2005
2 123 3/24/2004
3 123 11/12/2003
4 345 3/25/2005
5 345 3/24/2004
6 345 11/12/2003
I am trying to take this format and convert it to the following:
Record Barcode Date LastDate
1 123 3/25/2005 3/24/2004
2 123 3/24/2004 11/12/2003
3 123 11/12/2003 NULL
4 345 3/25/2005 3/24/2004
5 345 3/24/2004 11/12/2003
6 345 11/12/2003 NULL
So far I have managed to pull the max(date) and place it in every record for lastdate. I also managed to take the max(date) for each barcode and place it in the lastdate for the records with the same barcode. Any sort of help would be appreciated.