Results 1 to 4 of 4

Thread: Date format

  1. #1
    Join Date
    Feb 2003
    Posts
    29

    Question Unanswered: Date format

    I have getting following date format when I run query in QA.

    2006-12-09 00:01:09.000

    How can I chage to 12/09/2006 00:01:09:000 format (MM/DD/YYYY HH:MMS) ?

    Thanks for your help in Advnace.

  2. #2
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12

  3. #3
    Join Date
    Feb 2003
    Posts
    29
    I used the convert as follows

    convert(varchar(20),starttime,101 )

    but it just retrun only the date 12/09/2006 it does not shows time

    I need time stamp too.

  4. #4
    Join Date
    Nov 2006
    Location
    UK
    Posts
    46
    Code:
    select convert(varchar(10), convert(datetime, '2006-12-09 00:01:09.000', 121), 103) + 
           ' ' + convert(varchar(12), convert(datetime, '2006-12-09 00:01:09.000', 121), 114)
    or the other way:

    Code:
    select convert(varchar(19), convert(datetime, '12/09/2006 00:01:09:000', 103), 121)
    Last edited by Kris Zywczyk; 12-11-06 at 06:33.
    Regards
    Kris Zywczyk

Posting Permissions

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