Convert Text to Date in SQL Server -
How do I convert text values like "18/06/11" such as "Date 2011-06-18 < / P>
I have tried the following
Convert (char, [InstrumentText], 106)
But the value remains in only one format < P> Thanks
The correct format for your string will be 103.
More Importantly, you do not need to convert datetime to
char :
(date, [Ins trumentText], 103) If you want to convert it back to string in yyyy-mm-dd format, you can do this:
Convert (varchar) (10), Convert (date, [InstrumentText], 103), 120)
Comments
Post a Comment