May 30th, 2006

susan

Brain twister of the evening

So, why does

update tx set service_date = '03-24-2000' where tx_number = 99999999

followed by

select service_date from tx where tx_number=99999999

return a value of June 19, 1894?

More to the point, why does it only do it in one place in the code, and work just fine everywhere else?

Hmpf.

(Incidentally, what happened on June 19, 1894, anyway? It doesn't seem to be a round multiple of time from any halfway reasonable epoch....)

UPDATE: because what I actually wrote was

update tx set service_date = 03-24-2000 where tx_number = 99999999,

without the quotes.

3 - 24 - 2000 == -2021.
-2021 / 365 == a little over five and a half years.
A little over five and a half years before January 1, 1900 == June 19, 1894.