varchar data type to datetime data type resulted in an out-of-range??

Posted by leen3o on Stack Overflow See other posts from Stack Overflow or by leen3o
Published on 2010-05-07T13:31:02Z Indexed on 2010/05/07 13:48 UTC
Read the original article Hit count: 218

Filed under:
|
|
|

Very weird problem occurred, I have moved a site from one server to another - All is working, but any query involving a date is playing up. I get the following:

DELETE FROM MYTABLE WHERE categoryId = -2 AND datecreated < '3/23/2010';

The conversion of a varchar data type to a datetime data type resulted in an out-of-range value

Now what's strange is I have changed the LCID to 1033 on the new server as the date is showing as US format and its still throwing an error! I then tried 2057 and again the same error? Made no difference.

I'm a little confused, as this is a working site from a server with IIS6 - The locale is 1033 on that server and it works perfectly!! :S

I have just tried thrown a Cdate() around the date too and yet again the same error???

Any ideas??

© Stack Overflow or respective owner

Related posts about vbscript

Related posts about asp-classic