August 25, 2011 at 10:13 am
I am getting error for this:
'CONVERT(datetime, '20101001', 112)', 'CONVERT(datetime, '20101231', 112)')
Can someone please let me know what is wrong in this convert.
Thank you
August 25, 2011 at 10:45 am
Use Following
select CONVERT(datetime, '20101001', 112), CONVERT(datetime, '20101231', 112)
Or For Dynamic
exec ('select CONVERT(datetime, ''20101001'', 112), CONVERT(datetime, ''20101231'', 112)')
Thanks
Kuldeep
Kuldeep Bisht
Simplion Technologies
http://mssqlguide.kuldeepbisht.com
August 25, 2011 at 11:11 am
bisht.kuldeep has it correct. you don't need the extra quotes in there, which cause a syntax error.
Follow me on Twitter: http://www.twitter.com/way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply