sql随机时间
时间:2021-07-01 10:21:17
帮助过:8人阅读
@endtime datetime
declare @starttime datetime
set @starttime=‘2017-09-01‘
set @endtime = ‘2017-11-24‘
declare @ctime datetime
select @ctime= dateadd(SECOND,
convert(
int,(
rand()
*datediff(SECOND,
@starttime,
@endtime))),
@starttime)
Select CONVERT(
varchar(
100),
@ctime,
25)
print @ctime
sql随机时间
标签:font ctime set select time arc varchar datetime convert