views:

1312

answers:

3

Surely there is a way to store a date value prior than 1-1-1900 in a column other than varchar? Or do I really have to break this out, and perform my own datetime library for date differences, sorting, and such?

Yes, I understand how datetime's are actually stored (an integer value from a specific date), but I remember there being another workaround from years ago. It's just slipping me now.

+7  A: 

smalldatetime vs. datetime!

http://msdn.microsoft.com/en-us/library/ms187819.aspx

http://msdn.microsoft.com/en-us/library/ms182418.aspx

!

mspmsp
Thanks, yeah I had told the dev to make that change and they were still having the same problem. Then when I saw the msdn article, I asked them to refresh their connection and try again, sure enough, 'datetime' worked this time. (Or they had not applied the change originally).
Adam
+3  A: 

Yes the SQL Server DateTime type can store dates from 1 January 1753.

Joe
With the proviso that you're buggered if you want to do (for example) a genealogy app to record someone born in 1536.
ConcernedOfTunbridgeWells
+1  A: 

SQL Server 2008 has the DATE data type which can range from 0001-01-01 through 9999-12-31.

With previous versions, your SOL if you need a date prior to 1753-01-01 (Minimum value for DATETIME).

David Thibault