July 19, 2012 at 7:51 am
Hi Friends,
I am trying to concatenate a string and datetime....i did it....but after concatenating , i am getting date and time like Jul 19 2012 7:18PM.
i must get the datetime like 2012-07-19 19:21:01.587 + string value.
is that possible?
give me your suggestions friends
Thanks,
Charmer
July 19, 2012 at 7:56 am
Charmer (7/19/2012)
Hi Friends,I am trying to concatenate a string and datetime....i did it....but after concatenating , i am getting date and time like Jul 19 2012 7:18PM.
i must get the datetime like 2012-07-19 19:21:01.587 + string value.
is that possible?
give me your suggestions friends
convert(varchar(22),MyDateTimeCol, 121) + ' ' + MyStringCol
July 19, 2012 at 7:57 am
i think you can use one of the built in convert formats.
--2012-07-19 09:56:46.040 MyString
SELECT CONVERT(VARCHAR,GETDATE(),121) + ' MyString'
Lowell
July 19, 2012 at 8:02 am
Thank you Lowell, Lynn...
I forgot the 121....
Thanks,
Charmer
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply