Skip to content
Advertisement

SQL Server – Deleting rows between a date range using SQL. Date conversion fails

This is the DELETE statement I wrote. There is an error that says:

Conversion failed when converting date and/or time from character string.

I know I have to write the correct date format, but I am not sure how that goes.

This question has not been answered elsewhere because the answers I saw did not specify date format (in the context that I am asking for)

Advertisement

Answer

You wrote 31st of February… Maybe….. that date doesn’t exists.

For a general idea of convert date:

Here you can find the complete list of values for third parameter of CONVERT https://msdn.microsoft.com/en-us/library/ms187928.aspx

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement