The column [PAYOFF DATE] has some blank values and some values in mm/dd/yy format.
I have to replace '/' with '-' and return the date as yyyy-mm-dd. The below query is doing it. The problem is that for all blank values, I am getting results as 1900-01-01.
Is it possible to replace 1900-01-01 with null and return other valid date values as is in yyyy-mm-dd format?
I am using SQL Server.
SELECT
cast(replace(a.[PAYOFF DATE],'/','-') as date)
FROM MTG a