I'm trying to write a script in C shell for selecting data from Informix database 8 working days in past.
So far I have sql code that calculate 8 days in past + Sunday and Saturday it looks like this:
select *
from ekzo
where datzah = today-
(case
when weekday(today) = 1 then 12
when weekday(today) = 2 then 12
when weekday(today) = 3 then 12
when weekday(today) = 4 then 10
when weekday(today) = 5 then 10
when weekday(today) = 6 then 10
when weekday(today) = 0 then 11
end)
I have created table "prazkal" with holidays that looks like this:
datpra 01.01.2014
nazpra Nova Godina
krapra SRI
datpra 06.01.2014
nazpra Bogojavljanje ili Sveta tri kralja
krapra PON
datpra 20.04.2014
nazpra Uskrs
krapra NED
datpra 21.04.2014
nazpra Uskr?nji ponedjeljak
krapra PON
...
I don't know how to extend my sql to calculate 8 working days in past, considering weekends and holidays.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…