Results 1 to 5 of 5

Thread: date format

  1. #1
    Join Date
    Jun 2012
    Posts
    1

    Unanswered: date format

    Dear Sir,

    please give a query for the date format

    in the sql we will get system date like 412000, i required date format like dd/mm/yyyy, please help me

    Regards
    Krishna

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    SELECT CONVERT(VARCHAR(20),datecolumn,103) ...
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Dates are stored as bit streams in the database, they only get converted to characters for output. For conversion and presentation of dates see:

    CAST and CONVERT (Transact-SQL)
    SET DATEFORMAT (Transact-SQL)
    International Features in Microsoft SQL Server 2005

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

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by Pat Phelan View Post
    Dates are stored as bit streams in the database,
    so is every other conceivable datatype, dude
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by r937 View Post
    so is every other conceivable datatype, dude
    You'd be amazed at the number of questions like this one that arise here on DBForums about how to store dates using specific formats. You and I take it for granted that the date is stored as a group of bits, but there appear to be many people that think of dates as being stored in a particular format.

    -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
  •