August 19, 2003 at 9:38 am
how do i re-format this string '010702' to '01/07/02' cast('010702' as datatime) gives me "Jul 2 2001 12:00AM"
HELP !!!!
August 19, 2003 at 9:45 am
Showing my SQL Age
substring(mystring,1,2) + '/' + substring(mystring,3,2) + '/' + substring(mystring,5,2)
August 19, 2003 at 9:53 am
i thought that may be the answer, i was hoping that i could use some function for it... THANKS !
August 20, 2003 at 5:15 am
Try:
SET DATEFORMAT mdy
SELECT CAST('010702' AS DATETIME)
-SQLBill
August 20, 2003 at 5:17 am
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