Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2006
    Posts
    17

    Unanswered: convert into to 'mm/dd/yyyy'

    Hi

    I have to convert int (like 20080214) into datetime format like 'mm/dd/yyyy.

    How to so that?. Please help me.

  2. #2
    Join Date
    Aug 2005
    Posts
    75
    There is no native function that I'm aware of that will do that automagically.

    Your best bet would be to create one using substring() to chop up the string. Google it.

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Code:
    SELECT Convert(DATETIME, '20080214', 12)
    -PatP

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    or:
    Code:
     SELECT Convert(DATETIME, CAST(20080214 AS CHAR(8)), 12)
    Or even better - do it in the front end.

Posting Permissions

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