Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MS SQL datetime prior than 1/1/1900

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.

like image 924
Adam Avatar asked Dec 09 '22 22:12

Adam


2 Answers

smalldatetime vs. datetime!

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

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

!

like image 89
mspmsp Avatar answered Jan 11 '23 22:01

mspmsp


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

like image 35
Joe Avatar answered Jan 11 '23 20:01

Joe