Skip to content
Advertisement

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

I want to display data between the said date range but it is showing the conversion error. What could be he problem?

Advertisement

Answer

Try using the standard form for dates:

Actually, the above uses ISO standard formats for dates, which almost always (but not always depending on internationalization settings) work in SQL Server. You can also drop the hyphens for 100% compliance:

I would also advise you to use >= and < — because such logic works for both dates and date/times:

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