Skip to the content ForoHackers
Log inJoin

Rant: our date column is a string in three formats

Databases
#956 · anonymous · · Report

Not naming the employer. Not naming the system. Just venting.

be me new on a project, first week find the column created it is VARCHAR(20) contains 2019-03-02, 02/03/2019, and sometimes 20190302 02/03/2019 is March 2nd or February 3rd? depends on who typed it nobody knows the person who knew left in 2016 there is a nightly job at 03:00 that "fixes" the dates nobody knows what it fixes, only that if you turn it off reports go weird it is documented in a README that says only "do not touch"

I came here to write software and ended up as an archaeologist. At least the pottery is not on fire.

#1253 · anonymous · · Report

"do not touch" README

Always the most informative documentation. Step one: copy the table, step two: log which rows the nightly job changes for a week. You will learn what it does by watching, like a nature documentary.

#1254 · anonymous · · Report

Add a real DATE column next to it, fill it with a conversion that rejects ambiguous rows into a review table, and make the app write both for a while. Then drop the old one. Slow, boring, correct.

#1255 · anonymous · · Report

Three formats is a luxury. I once had a column where the year was sometimes two digits, and they were different depending on the century of the person who typed it.

Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply