03-25-05 11:02 PM
The datetime field in sql is stored as 2 four byte number, one is the number
of days before or after 1/1/1900, the other the number of milliseconds after
midnight.
The actual limitation is imposed not by storage, but the julian/gregorian
calendar issues. The big three (DB2, Oracle, SQL) all handle valid date
ranges differently.
If you need to store dates outside of the ranges SQL server supports ( I
have an application that requires this) I suggest creating a UDD for the
date field. Define it as char(8), then create rules to enforce valid date
structure (eg. pos 1-4 (0-9), pos 5 (0-1) [for months] pos 6 (0-9) pos
7
(0-3) day and pos 8 (0-9) next create a couple of UDF's for any date math yo
u
might need. This might seem like a lot of work, but it works great !!! (we
ported from DB2 to SQL) and I avoided the need to make application changes b
y
doing this.
"Danicaban" wrote:
> Hello: i´m developing an application where must be loaded a lot of histor
ical
> data, including birth dates before 1753.
> I´ve been searching the web and find suggestions like "it´s an input
> mistake" or "take dates as string", but i really need to use those fields
> like dates.
> Can you say me if there is another solution, or tell me why is this
> restriction applied in SQL SERVER ? What is the benefit of this restrictio
n ?
> Thanks.
[ Post a follow-up to this message ]
|