In MS SQLServer, only the datetime type, date and time are together, such as 2004-12-19 23:12:20,
Sometimes, in the SQL statement, you will be more troublesome, but there is also the following method, summarize
For example, it is required to obtain records of 2004-19, so
A) WHERE datediff (DD, DateTimeColumn, '12 / 19/2004 ') = 0
B) WHERE CONVERT (VARCHAR (20), DateTimeColumn, 101) = '12 / 191/2004 'c) Where DateTimeColumn Like '12 / 19/2004%'
D) Where Year (datetimecolumn) = 2004 and month (datetimecolumn) = 12 and day (datetimolumn) = 19