Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2010
    Posts
    2

    Unanswered: URGENT: Cannot save date to French format

    Greetings to all,

    I Have a problem, I have imported the database from SQL Server 2000 to SQL Server 2008, the collation of the old database is French, the collation of the new database is French, However when the database has been attached to SQL Server 2008 the date is in US English format. The collation of the new db is french.
    So the application that is running in the old SQL Server 2000 DB, when we run it on the new DB we get an error because of the date that is not in French format.

    Any Help will be appreciated , as we cannot upggrade to tSQL 2008 because of this problem.

    Thanks in advance.

    Abdu

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    I am hoping that the problem is only with some string constants. If this is the case, then you only need to modify some code:

    Code:
    select getdate(), convert(datetime, '20-04-2010', 103)
    If you are storing dates as strings, then you have a lot more work ahead of you.

  3. #3
    Join Date
    Apr 2010
    Posts
    2
    The company have inherited this application, they do not have the code source. So that's the problem I dont have control of the app. I'm hoping to solve the problem within SQL Server. The dates are stored as Shortdatetime.

    Thanks for the help!!

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    There are several thousand possible causes for this problem, but all of them lead to one of two solutions. See SET DATEFORMAT or sp_defaultlanguage.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  5. #5
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by Abdu View Post
    I'm hoping to solve the problem within SQL Server. The dates are stored as Shortdatetime.
    Datetime values stored in the database don't have any format - they are just numbers. They are formatted by whatever client retrieves them. Try setting the locale on the client computer to French.

  6. #6
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    True that the client machine's locale will affect how dates are rendered on the client, but Convert() runs afoul of the conversions that are referenced too.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •