SQL syntax to delelte data is not a date format
Posted on 2016-09-04
I am importing data from a third party software
One of the fields they have is an nvarchar(200) but holds dates in format : mm/dd/yyyy
Most of the entries in that field are in fact dates, but some aren't. I need to delete any entries in that field which are NOT a 'date' or in date format 'mm/dd/yyyy'
The table name is: Dependents
The field name is: DepLastUSEntry
Also some dates are in : 07/27/03
Can they be converted to : 07/27/2003 ?
And also: 8/25/2003 into 08/25/2003
Maybe: 8/13.2002 into 08/13/2002
Anything different that cannot be converted into a mm/dd/yyyy should be deleted, and if the conversions above cannot be done then remove any date that is not mm/dd/yyyy