AlbertKim247
Programmer
My question has to do with identifying the newest record in a dataset that uses the NEWID function to assign a value for the primary key field.
I need to determine the newer of two records that were both created on a particular date.
For example, in a recordset of 2 records created on the same date, could I use the max value of the NEWID value to determine which of the records was created last?
Sample dataset:
Header: KeyField|Name|DateCreated
Record1: 77E08446-01EF-4BEE-BBAB-6ED460D471BB|John Smith|1/1/2007
Record2: D9BB5E77-D9DA-4D40-956F-F16C0FBAB206|John Smith|1/1/2007
Record1 and Record2 were both created on the same date and have the same exact values, but I need to know which one was created last. If I group on all the fields, and take the max value in the KeyField, I would get one record. Would the resulting record be the one that was created last?
Assumptions:
1. From what I understand, the NEWID function creates unique values by taking the mac address of the computer it is created on, and a datetime stamp.
I need to determine the newer of two records that were both created on a particular date.
For example, in a recordset of 2 records created on the same date, could I use the max value of the NEWID value to determine which of the records was created last?
Sample dataset:
Header: KeyField|Name|DateCreated
Record1: 77E08446-01EF-4BEE-BBAB-6ED460D471BB|John Smith|1/1/2007
Record2: D9BB5E77-D9DA-4D40-956F-F16C0FBAB206|John Smith|1/1/2007
Record1 and Record2 were both created on the same date and have the same exact values, but I need to know which one was created last. If I group on all the fields, and take the max value in the KeyField, I would get one record. Would the resulting record be the one that was created last?
Assumptions:
1. From what I understand, the NEWID function creates unique values by taking the mac address of the computer it is created on, and a datetime stamp.