Select Random date time in Sql Server

June 17th, 2010 by admin Leave a reply »

This query will select a random  date time in the past 60 days

select  cast( cast(getdate() as int)  -60 * rand ( cast( cast(newid() as binary(8)) as int ) )  as DATETIME )
Advertisement

Comments are closed.