The only date in SQL

Pros:
No varchar<->datetime conversions required
No need to think about the locale
-- 2 day ago SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, DATEADD(DAY, - 2, GETDATE()))) -- today SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE()))
About the author
Performance freak
Comments
Join the discussionNo comments yet. Be the first to comment.




