>I just made some tests and it seems to me that the random function RAND() is near 10000000 reliable than yours. But I'm not very sure that I correctly tested. It's too much...
>
>Anyway, what you need is something like that:
>This should replace your day(date()):
>
>
Function Last2Digits
> Local CurrDate, AproxDayOfYear
> CurrDate=date()
> AproxDayOfYear=(month(CurrDate)*31+day(CurrDate)*100+;
> mod(year(CurrDate),100)
>Return chr(int(AproxDayOfYear/256))+chr(mod(AproxDayOfYear,256))>
>Function UniqueKey
> Local RetValue, L2D
> RetValue=seconds()
> L2D=Last2Digits()
> do while RetValue = seconds() && Waits until seconds is changed
> enddo
>Return str(Retvalue*1000,8)+L2D
>
>This is a real unique value in a century!!!
Vlad
Let's face it. NO system is 100% foolproof. That's why I check for existing values & trap errors.
I have always loved putting sticks in Bee hives! (s)
Tom