Reputation: 9299
I have a column, called date_col
I would like to fix the invalid dates, for example february 31, and convert them to valid dates.
I tried this:
CAST(CAST(date_col AS TIMESTAMP) AS DATETIME)
But I get the following error:
Arithmetic overflow error converting expression to data type datetime
Upvotes: 0
Views: 299
Reputation: 387
First of all, you can use ISDate function to check if the data is correct
Upvotes: 2