Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2003

    Unanswered: How to retrieve DATETIME format?

    Hello, everyone:

    My table has a column that is DATETIME data type. The original format likes "1/21/2004". I want to check data lengh. However when I read the data by SELECT, SQL Server change the format to "Jan.-21-2004" automatically. Does any one has an idea to keep original datetime format? Thanks.


  2. #2
    Join Date
    Apr 2002
    Toronto, Canada
    there is no original format

    you may use a format for input that sql server understands, but internally, the date is stored as an integer (number of days since the base date)

    check out BOL (Books Online) for details

    if you want to see a specific format when you SELECT a datatime value, then use the CONVERT function | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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