0

Application is getting this issue : java.sql.SQLException: The conversion of a nvarchar data type to a datetime data type resulted in an out-of-range value."

Back end SQL Server 2014. How can i resolve this issue?

1
  • If your problem is the result of a query, try your query with WHERE TRY_CONVERT(DATETIME, [YourColumn]) IS NULL. That might help.
    – Nestor
    Apr 30, 2017 at 20:41

1 Answer 1

1

If this results from you passing data INTO SQL Server, log your parameters before you issue the query.

If this results from you getting data OUT of SQL Server, remove your cast/convert functions and look at the data. Odds are you're casting/converting a field that isn't guaranteed to be a date.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.