Sunday, 11 August 2013

Covert varchar to date format

Covert varchar to date format

I want to covert varchar (50) column to date format. I used following code:
Update [dbo].[KYCStatus062013]
Set [REGISTRATION_DATE_]= convert(datetime,[REGISTRATION_DATE_] ,103)
But there is an error that says:
Msg 241, Level 16, State 1, Line 1 Conversion failed when converting date
and/or time from character string.
I want this format: dd-mmm-yyyy. I do not have any option to create
another table / column so "update" is the only way I can use. Any help
will be highly appreciated.

No comments:

Post a Comment