September 14, 2010 at 3:51 am
Environment
Server:
Windows 2003
MSSQL 2008
MSSQL 2008 Management Studio
Regional settings: en-za (default, i.e no changes made after install)
I write the following T-SQL:
Select TranDate from tblTranMaster where TranDate = '2010-31-12 00:00:00.000'
Result:
2010-12-31 00:00:00.000
Could someone please explain to me how this works?! The regional setting surely means that I should be able to query with '2010-12-31 00:00:00.000' (same format as result, yes I know its varchar, but I only get the varchar to date-time overflow error. Does it not look at the regional settings to determine the format of the varchar I am trying to compare against?
I am using the SQL Management Studio tool to create the query and test because I picked up the error when the application (C#) we are developing didn't return any data.
Dave
September 14, 2010 at 5:08 am
i came accros this before as well and not too sure on the resolution 🙂
as an interim solution try
set dateformat ymd before your select statement
September 14, 2010 at 6:42 am
Thank you, although it's not really possible because we cannot do that realistically. We are using LLBLGen and I'd really like to get to the bottom of it and not make a crude fix in the LLBLGen code generator...
Dave
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply