Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2004
    Posts
    25

    Red face Unanswered: How to default the date format as dd/mm/yyyy

    Dear all:

    Anyone knows how to set the default fate format at SQL server as dd/mm/yyyy. Thanks for the help!

  2. #2
    Join Date
    Jul 2004
    Posts
    52
    For automatically converting strings to dates you can specify how your dates are formated like this:

    SET DATEFORMAT DMY

    If you want to convert a date to a string, see convert(varchar,datecolumn,STYLE) in books online. There are many styles available.

  3. #3
    Join Date
    Sep 2004
    Location
    CA
    Posts
    41
    cast(convert(char(10),getdate(),101) as datetime)

  4. #4
    Join Date
    Feb 2004
    Posts
    193
    Actually,

    select cast(convert(char(10),getdate(),101) as datetime)

    returns: 2004-11-16 00:00:00.000

    And....

    select convert(varchar,getdate(),103)

    returns: 16/11/2004

Posting Permissions

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