Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2003
    Posts
    29

    Unanswered: Date filed conversion.

    I am running query on SQL 2005 and want to convert the date from 2010-3-2 17:45:30 to 3/2/2010 5:45:37 AM

    The date column is set as datetime in the table.

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912

  3. #3
    Join Date
    Feb 2003
    Posts
    29
    this one does not include hh:mm:ss AM or PM

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Heh - either you didn't read it, didn't understand it or did not care for what he told you.

    All the formats are here:
    CAST and CONVERT (Transact-SQL)
    You will have to bodge your formatted string from those supported

  5. #5
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Conversions that are locale specific (such as date or money to string) should be performed by the presentation layer. It is nearly always a programming error to handle formatting at any other layer because that makes it practically impossible to support more than one locale.

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