Knowledgebase
Input of Date data fails
Posted by zz-James Moir on 21 June 2016 04:08 PM

Issue

When dates are input this produces an error similar to :

The conversion of char data type to smalldatetime data type resulted in an out-of-range smalldatetime value


Solution

When you are working with dates in SQL server use the internationalised ISO date format, which is "YYYYMMDD" (no separators). This type of date will be accepted regardless of the language setting, and therefore will produce predictable results on any SQL server instance.

You can find out more about this here:

http://support.microsoft.com/kb/173907