Reputation: 93348
How can I convert a varchar field of the form YYYYMMDD to a datetime in T-SQL?
Thank you.
Upvotes: 7
Views: 38735
Reputation: 69
Use the CONVERT() function?
http://msdn.microsoft.com/en-us/library/ms187928.aspx
Upvotes: 0
Reputation: 17610
select convert(datetime, '20081030')
Upvotes: 20