I feel a rewrite coming on
So I'm trying to make this database generic, in that, instead of hard-coding certain things to do with dates and times, they're obtained from tables. Naturally, that's where I've used the not-available views. Just spent a while bodging up something to make the views available as (statically-generated) tables instead, only to find that at least one of the date-manipulation functions I'm using in the queries isn't available, etc.
Time to look at date manipulation in PHP instead, I think. Current Mood: frustrated