Results 1 to 3 of 3
  1. #1
    Join Date
    May 2003
    Location
    Pinoy in NJ
    Posts
    104

    Unanswered: Text-to-Date Conversion

    How can I convert this string into the correct SmallDateTime type.

    STRING = "060104" [This is JUNE 1, 2004]. When I use a CAST, I get [JANUARY 4, 2004] instead.

    TIF

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    The ISO standard (which Microsoft usually follows) would interpret '060104' as January 4, 2006 if that helps any. As the format you are trying to convert (mmddyy) is non-standard as far as MS-SQL in concerned, I suspect that you'll have to write an expression to convert it to a date.

    -PatP

  3. #3
    Join Date
    May 2003
    Location
    Pinoy in NJ
    Posts
    104
    Thanks. I just manipulated the string to the standard format to use the cast.

Posting Permissions

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