How can I select 12/20/2008 in where
clause of sql?
The server is SQL server 2005.
select * from tblErrorLog where errorDate = '12/20/2008'
The DATEDIFF function can also be used in a WHERE clause as well as ORDER BY and HAVING clauses. The units of time available for the DATEDIFF are the same as those for the DATEADD function.
WHERE datetime_column >= '20081220 00:00:00.000' AND datetime_column < '20081221 00:00:00.000'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With