views:

47

answers:

2

I am confused reading statements in "Why is 1899-12-30 the zero date in Access / SQL Server instead of 12/31?"

Was there date type in SQL Server before 2008 version? I cannot find.
In SQL Server 2008 zero date is 0001-01-01. Were there any date type before (in previous SQL Server versions) how is it backward compatible?

+3  A: 

No. Prior to SQL Server 2008, there was only the datetime and smalldatetime types.

Data type...............Range..................................................................Accuracy
datetime..................January 1, 1753, through December 31, 9999.....3.33 milliseconds

smalldatetime..........January 1, 1900, through June 6, 2079............... 1 minute

Please see: Date and Time Data in SQL Server 2008, specifically the bit that says "Date/Time Data Types Introduced in SQL Server 2008"

Mitch Wheat
I asked about date type but not about other types
vgv8
@vgv8: And I just told you there wasn't one!! Rudeness will not get you help.
Mitch Wheat
Being exact or specific is not synonym of rudeness. You answered to something I had not ever asked. I see it in opposite way. Where is any date type in your answer?
vgv8
@vgv8: I have answered your question.
Mitch Wheat
Thanks, I just needed a 3d (or, it happened, 2nd) opinion
vgv8
@vgv8: that's quite rude too...
gbn
vgv8
@vgv8: .If the answer wasn't what you wanted, then perhaps the question needed to be rephrased? Anyway, you have an answer to your question, so all's good.
Mitch Wheat
+1  A: 

In SQL Server datetime datatype the minimum date that can be stored is 1 Jan 1753.

However the datetimes are stored as numeric offsets to a base date of 1900-01-01 00:00:00.000

SELECT CAST(-0.25 AS DATETIME) /*1899-12-31 18:00:00.000*/
SELECT CAST(0 AS DATETIME) /*1900-01-01 00:00:00.000*/
SELECT CAST(0.25 AS DATETIME) /*1900-01-01 06:00:00.000*/

1899-12-30 has no significance in SQL Server.

SELECT CAST(CAST('1899-12-30' AS DATETIME) AS FLOAT) /*Returns -2*/
Martin Smith