Ask a Question

Knowledge Base

Tools
Categories Rss

Input of Date data fails

Reference Number: AA-00238 Views: 1266 Created: 2010-11-16 13:29 Last Updated: 2011-01-28 10:15 0 Rating/ 0 Voters

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

Info Ask a Question