May 21, 2009 at 10:42 am
DECLARE @Date DATETIME
SET @Date = '2009-05-01 13:43:15'
SELECT REPLACE(CONVERT(varchar(13),@Date,10),'-','')
Check out the CONVERT function in BOL
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
May 21, 2009 at 11:11 am
Thanks, that worked. I modified it a bit for a column I need to format.
replace(convert(varchar(13),end_date,10),'-','')
May 22, 2009 at 2:12 am
Glad I could help 🙂
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
Viewing 3 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply