June 1, 2011 at 7:41 pm
Hi,
can any one help me in converting the getdate() into YYYYMMDDHHMMSS format?
can convert it into YYYYMMDD format using Select CONVERT(VARCHAR(8), GETDATE(), 112)
but cannot the rest together.
Note: for the time i dont want the colons in between.
Thanks in advance
Prasad
June 1, 2011 at 8:18 pm
try this
left(replace(replace(replace(replace(convert(varchar(23),GETDATE(),126),'-',''),':',''),'T',''),'.',''),14)
June 1, 2011 at 11:27 pm
Hi
You can script hear!
Select CONVERT(VARCHAR(10), GETDATE(), 112) + '' + replace(CONVERT(VARCHAR(20), GETDATE(), 108),':','')
June 1, 2011 at 11:36 pm
Both Works...Thanks a lot.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply