The Days of Horror Story

Quite a while ago, I wrote out some of my experiences at a previous employer, as a cathartic release on the tension they caused me. It helped a lot,

Todays The Daily WTF titled "Got Time?" reminded me of one of those horrible hacks I had to deal with when I was there.

We used to have one of those business rules. "X business days from now". Where weekends, and national public holidays, were not considered "business days". Because this business rule was observed in the Oracle Forms interface that was used by our operations staff, a way to take now() + N business days was needed.

# select * from days_of_week order by num;
day_of_week num
----------- ---
31/07/2005 401
03/08/2005 402
04/08/2005 403

In this entirely ficticious example from my memory of this table, that's what the data looked like. All saturdays and sundays and public holidays were listed in the table with a blank 'num'. To find a date 10 business days from now, you would do: select day_of_week from days_of_week where num = (select num from days_of_week where day_of_week = today()) + 10.

Every so often we would "run out of days" and an email would be sent. Then a script would be written to add another batch of days to the table, then we'd be good until we run out again...

I've been at my current employer for over 5 years now, and am extremely happy I left tripe like what I've just dredged out of my memory behind.


ahmed said...

mudarse de la casa de sus padres es un cambio importante en la vida, con muchos pasos y detalles a considerar: esta guía está diseñada para aliviar el estrés y disolver el misterio de mudarse por primera vez.شركة نقل اثاث
شركة نقل عفش بالخرج

Antony Christ said...

It was nice to read your blog. If anyone needs any type of case study and assignment help at the cheapest price then visit our website:- My Case Study Help. We are the best Assignment Help Australia website, provide all types of services for MBA Assignment Help, Nursing Case Study Help, Law Case Study Help and Engineering students. Avail Assignment Writing Service with the world's most trusted and no1 company for Case Study and Assignment Help in Australia. Get professionally prepared assignment by our amazing Case Study Writers with 100% quality check and plagiarism free paper.