i should know this BUT.....

  • how do i re-format this string '010702' to '01/07/02' cast('010702' as datatime) gives me "Jul 2 2001 12:00AM"

    HELP !!!!

  • Showing my SQL Age

    substring(mystring,1,2) + '/' + substring(mystring,3,2) + '/' + substring(mystring,5,2)

  • i thought that may be the answer, i was hoping that i could use some function for it... THANKS !

  • Try:

    SET DATEFORMAT mdy

    SELECT CAST('010702' AS DATETIME)

    -SQLBill

  • Or better yet:

    SET DATEFORMAT mdy

    SELECT CONVERT(varchar(10), '010702', 101)

    -SQLBill

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply