Random Number

The following SQL script will generate a single random number:

SELECT CAST(1000000-CEILING(RAND()* 899001) + (DATEPART(ss, GETDATE()) * 1000 ) + DATEPART(ms, GETDATE()) AS INT)

2 comments
Anonymous 27 Nov 2010 at 4:01 am

how to count hours based on date

Derek Dieter 27 Nov 2010 at 8:19 am

hi, to do this use:

Datediff(hh,date1,date2)

Featured Articles

 Site Author