Here's a quick and easy way to get the midnight timestamp for the current day:
SELECT DATEADD(dd, DATEDIFF(dd, 0, GETDATE()), 0)
For more tricks on calculating SQL DateTimes, see http://www.databasejournal.com/features/mssql/article.php/3076421
Subscribe to:
Post Comments (Atom)
1 comment:
Thanks, that worked perfectly.
Post a Comment