Morris Logan
Old Hand
Points: 338
More actions
April 18, 2007 at 5:26 am
#116921
Hi Folks,
I am having a problem where I want to return the current date and time in two columns without any formatting,
eg:
CurrentDate CurrentTime
20070418 1222
Is there an easy way to do this?
All help is gratefully recieved!! Thanks in advance
Cheers
Morrislgn
SwePeso
SSC-Dedicated
Points: 39757
April 18, 2007 at 5:30 am
#701086
SELECT
CONVERT(VARCHAR, CURRENT_TIMESTAMP, 112),
STUFF(CONVERT(VARCHAR(5), CURRENT_TIMESTAMP, 108), 3, 1, '')
N 56°04'39.16"E 12°55'05.25"
April 18, 2007 at 5:36 am
#701087
Excellent - thanks very much!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply