Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2003
    Location
    MN
    Posts
    10

    Unanswered: convert number to date datatype

    easy question here.

    I have:
    0123
    0125
    0227
    0327
    04..
    05..
    06..
    07..
    08..
    09..
    ..
    1231

    The first two numbers is the month and the second two numbers is the day of the month.

    I need to display 01 as Jan, 02 as Feb and so on.

    left(field1, 2) --- I know this grabs the first two numbers, but how do I convert it to a date data type?

  2. #2
    Join Date
    Oct 2001
    Location
    England
    Posts
    426
    dateadd(dd,convert(int,right(field1,2)),dateadd(mm ,convert(int,left(field1,2)),'19000101'))

Posting Permissions

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