Yes alpine
nice observation and also the starting day mustn't be a weekend or holiday either that's why I used master/detail relationship
I made a table OCA (each year must be manually updated ) :
CREATE TABLE "OCA" (
`ID` INTEGER,
`DEF` VARCHAR ( 50 ),
`ST` VARCHAR ( 50 ),
PRIMARY KEY(`ID`)
and I add every official holidays (DEF:name of holiday/event ; ST: date ) and I linked VAC dataset with OCA datasource linked field is ST .
Well, to stay in the Spirit of this:
Could also easily be done in SQLite directly (untested, since it's been a long time i've done something like that):
Introduce a new Column "Offset" (or whatever you like to call it),
create two Triggers (After INSERT and After UPDATE), which checks if the calculated ED-Date falls on such a Holiday.
If yes, Offset=1 else Offset=0
The generated columns just have to be adjusted with that Offset
And now i'm going to introduce further complications:
What about if there are two consecutive Holidays?
Christmas-Day and Boxing-Day come to mind.
Your offset ED:=ED+1 wouldn't work