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

  • Sue needs developers!

    Call Genie is inventing the future of voice-enabled mobile local search, and we need the best software team in the industry to do it. As a member of…

  • Worky goodness

    Today was a very good day at work. (And yesterday was an exhausting one.) Tomorrow looks promising, too, if I don't collapse from exhaustion between…

  • Not Ready for Prime Time

    Signs that an open source project is Not Ready For Prime Time: you open up the documentation, and it reads "Lorem ipsum dolor sit amet, consectetuer…

  • 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