Susan Davis (futabachan) wrote,
Susan Davis
futabachan

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.
Tags: geek, work
Subscribe

  • Thanks, everyone.

    Thanks, everyone, for your birthday wishes. It's been a rough year, and a particularly rough month, and I feel like I've made a complete hash of the…

  • Happy now.

    I am the luckiest woman in North America.

  • Suddenly free this weekend, after all....

    I didn't think I'd be able to go to alt.polycon because of a family wedding this weekend... but it turns out that we can't go anyway (we'd get there…

  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 9 comments