sql server - Efficient way to compare a datetime to midnight in SQL -
i want select sql server table datetime field > midnight of current date.
i'm using following ask if there more efficient way it?
start_time > (select dateadd(d,0,datediff(d,0,getdate())))
if convert or cast current date date instead of datetime, believe can use in because date data type set midnight:
where start_time > convert(date, getdate())
or
where start_time > cast(getdate() date)
Comments
Post a Comment