Created
August 18, 2011 14:03
-
-
Save phpleo/1154128 to your computer and use it in GitHub Desktop.
SQL DateTime and comparison
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- http://demiliani.com/blog/archive/2006/01/19/3384.aspx | |
WHERE DateDiff(dd, OrderDate, '01/01/2006') = 0 | |
WHERE Convert(varchar(20), OrderDate, 101) = '01/01/2006' | |
WHERE Year(OrderDate) = 2006 AND Month(OrderDate) = 1 and Day(OrderDate)=1 | |
WHERE OrderDate LIKE '01/01/2006%' | |
WHERE OrderDate >= '01/01/2006' AND OrderDate < '01/02/2006' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment