Technical Article

Display current date minus the time

,

This script will get you the current date minus the time. It will display all zeros instead.

DATETIME is stored as a number in SQL and less internal conversions are will be used then other methods. Microsoft generally uses this method.

SELECT CONVERT(DATETIME, FLOOR(CONVERT(FLOAT, GETDATE())))

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating