>>With GUID you need to modify this method a bit. How many chars is your GUID? Remove CTOBIN/BINTOC then and use simple
RIGHT(MAX(DTOS(effDate) + sth_pk),16)
if your GUID 16 chars.
>
>I see what's going on here. Neat trick! The max causes it to pick the highest date and the pk is added on. Taking the right most part of the string results in the PK.
>
>This technique is a little quicker too. By the way, who showed you this technique?
>MisterX's 52.324
>Borislav's 57.408
>and Sergey's 77.366
I told at least 5 times in this thread and in tek-tips, but I repeat just once more: :)
It's in a FAQ on a Russian web-ste wrriten by Vladimir Maximov with the idea originated by Igor Korolev.
If it's not broken, fix it until it is.
My Blog