Create A GUID from two columns

ECEK

Registered User.
Local time
Today, 09:27
Joined
Dec 19, 2012
Messages
717
My table contains people who have a unique identifier and secondary identifier

The secondary identifier links to the other person. so

Name ID ID2
Jack 001 002
Jill 002 001

Im trying to automate both of these records having the same GUID

any ideas?
 
GUID: Iif(ID1<ID2, ID1 & ID2, ID2 & ID1)

So both of those records get 001002 as their GUID.
 
Actually thinking about if further, I would format both ID values to a specific length that was equal to the longest ID possible:

GUID: Iif(ID1<ID2, Format(ID1, "000000") & Format(ID2, "000000"), Format(ID2, "000000") & Format(ID1, "000000"))
 
Utterly brilliant plog: I've tried all my permutations and it works perfectly. Many thanks.
 

Users who are viewing this thread

Back
Top Bottom