Error in SQL statement caused by invalid date format
Posted on 2007-07-20
This is my select statement: select COUNT(*) from tBooks where DateU > '20/07/2007 00:00:00'
The locale is en-GB; there is nothing in tBooks;
This is the error message I am getting: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
I can see why I'm getting it, but I thought that the locale would take care of this. What do I have to do to the '20/07/2007' (which is in a variable of type DateTime)?
(For those of you who have been answering my previous questions and wonder what's going on, I am in the process of "internationalizing" my applicatation, and am making progress... one step at a time).