none
DATEFIRST

    Question

  • Hi All


    We have a problem with DATEFIRST.

    Different users connecting to SQL 2005 and querying the value for DATEFIRST (SELECT @@DATEFIRST). Some users get 7 (Sun), others get 1 (Mon).

    What is giving rise to the different values ?
    (All users seem to have the same language settings in SQL and their regional settings are the same).
    This is impacting stored procs calling DATEPART that are run from within VB6 Apps using ADO.

     

    Thanks in advance

    Preet

     

    Thursday, December 06, 2007 1:13 PM

Answers

  • Just looking over my old posts. This effect (and dateformat) is due to the default language set against the user.
    sp_helplanguage lists what the default settings would be for users set up with differing default languages. In our case, some users had English, while others had British English.

    • Marked as answer by Preet_S Thursday, November 05, 2009 5:31 PM
    • Unmarked as answer by Preet_S Thursday, November 05, 2009 5:31 PM
    • Marked as answer by Preet_S Thursday, November 05, 2009 5:32 PM
    • Unmarked as answer by Preet_S Thursday, November 05, 2009 5:33 PM
    • Marked as answer by Arnie RowlandMVP, Moderator Friday, December 18, 2009 7:14 PM
    Thursday, November 05, 2009 5:29 PM

All replies

  • Give a look to DATEFIRST and @@DATEFIRST in books online.  How are you using DATEFIRST?  It sounds like this might be some self-inflicted pain.

    Thursday, December 06, 2007 4:42 PM
  • Yes have read Books online, this is always my first port of call.
    We are not setting a value for @@DATEFIRST so according to BOL default will be used ( 7- Sunday).
    However when different users connect to the server in question using Management studio SELECT @@DATEFIRST returns different values i.e. 7 (Sunday) and some get 1 (Monday).

     

    Friday, December 07, 2007 10:11 AM
  • Just looking over my old posts. This effect (and dateformat) is due to the default language set against the user.
    sp_helplanguage lists what the default settings would be for users set up with differing default languages. In our case, some users had English, while others had British English.

    • Marked as answer by Preet_S Thursday, November 05, 2009 5:31 PM
    • Unmarked as answer by Preet_S Thursday, November 05, 2009 5:31 PM
    • Marked as answer by Preet_S Thursday, November 05, 2009 5:32 PM
    • Unmarked as answer by Preet_S Thursday, November 05, 2009 5:33 PM
    • Marked as answer by Arnie RowlandMVP, Moderator Friday, December 18, 2009 7:14 PM
    Thursday, November 05, 2009 5:29 PM