Susan Davis (futabachan) wrote,
Susan Davis

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?


(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

  • Done.

    I'm finally home from the last trip to Erie to clean out Mom and Dad's house. It's been exhausting. I'm glad to have some time to just shut down now.…

  • Still here

    Mom's made of tough, tough stuff. She's been at death's door five times, and rallied each time. This time looks to be for real: she's been…

  • Oh, crap.

    My father has been diagnosed with dementia. Today, he was pulled over by the police, and can't drive any more. This may mean that my parents won't be…

  • Post a new comment


    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.