[Solved] Convert nvarchar(255) to date SQL


You can take advantage of SQL Server’s flexibility to recognize various date formats.

If you have the right regional settings, this should just work:

cast(mycol as date)

This gives you back a value of date datetype that corresponds to the input string;

Demo on DB Fiddle:

select cast('Jan 18 2019 12:00AM' as date)
| (No column name) |
| :--------------- |
| 2019-01-18       |

solved Convert nvarchar(255) to date SQL