Excel dates differ from SQL dates
Posted: Thu Dec 04, 2008 2:17 pm
One of those things that you never need to know till it trips you up. The integer representation of a date differs between Excel/Access and SQL. Eg 3 November 2008 in Excel is 39755 but in SQL its 39753.
There are two reasons for this, one is because Excel starts counting on 0 Jan 1900 while SQL starts on 1 Jan 1900. Two is because a very early version of Excel had an error in the calculations for leap years: it mistakenly assumed that 1900 was one, whereas in reality, it
wasn't. They could not fix this in later versions, because that would break compatibility.
Probably a useless fact, but I thought I'd share it anyway as it almost had me sending an accusatory to a user implying imbecility.
Martin
There are two reasons for this, one is because Excel starts counting on 0 Jan 1900 while SQL starts on 1 Jan 1900. Two is because a very early version of Excel had an error in the calculations for leap years: it mistakenly assumed that 1900 was one, whereas in reality, it
wasn't. They could not fix this in later versions, because that would break compatibility.
Probably a useless fact, but I thought I'd share it anyway as it almost had me sending an accusatory to a user implying imbecility.
Martin