Regional settings on client and server has no effect! What am I missing?

  • 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

  • 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

  • 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