Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2003
    Posts
    1

    Arrow Unanswered: insert a date with dmy format

    Hi everybody

    I am very new MSSQL server and need to run queries from a PHP script that would insert formated dates (dd/mm/yyyy).

    For the time being, mssql seem to accept any type of data I enter:
    ex:
    12/13/2003
    13/12/2003

    I think it is because the systeme is set to English-US.

    Would there be a way to change this to just English and not US??
    or could you help me with my query??

    thank you
    qali

  2. #2
    Join Date
    Oct 2002
    Location
    BC, Canada
    Posts
    17

    Re: insert a date with dmy format

    Hi there,

    You can change Regional Settings on tour server, this will affect all applications that are running on it, but it will force standard date format for all dates in database.

    Other option is to run

    SET DATEFORMAT dmy

    before your SQL statement, it will apply to this connection only, so you have to run it (script it in your code) for each individual connection that your application establish.

    Cheers, Marin

    Originally posted by qali
    Hi everybody

    I am very new MSSQL server and need to run queries from a PHP script that would insert formated dates (dd/mm/yyyy).

    For the time being, mssql seem to accept any type of data I enter:
    ex:
    12/13/2003
    13/12/2003

    I think it is because the systeme is set to English-US.

    Would there be a way to change this to just English and not US??
    or could you help me with my query??

    thank you
    qali

Posting Permissions

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