Posted on May 31, 2006
What day was it, a month ago, anyway?
Sometimes I really ENJOY bugs in other people’s software. This one might be a feature; I don’t know.
If someone comes up to you today and asks you what the date was a month ago, do you think you could figure it out? I think I could make something up that sounded reasonably accurate. Today, at least in my world, is May 31st. If you us the Teradata database, and ask IT what it thought the date was one month ago (date – INTERVAL ‘1’ MONTH), it explodes. Error message. Very bad.
Apparently, it’s unethical to ask the computer these difficult questions. What Teradata WANTS to do is tell you that a month ago, today, was April 31st. Of course, April 31st doesn’t exist (30 days hath [hath?] Setpember, APRIL… You remember the drill.), so it poops its pants. Or something. Personally, I’d have no problem if someone told me that a month ago today was April 30th (I’d have no problem if they told me it was April 31st; I really don’t pay that much attention). But still, tell me SOMETHING.
This is the sort of thing I deal with on a near-daily basis these days.
UPDATE: Teradata’s even more freaky: the example above works like I mentioned, but if you use “add_months(date, -1)”, it works the way I’d like! Totally twilight-zone over here.
You really are a geek, honey. S’cute.