Subject Re: Caculating specific dates for each year
Author Svein Erling Tysvær
Hi Rob, I know even less than you! I don't even know if UK tax years
always start 1 May, if it is determined by the moon like Easter, or if
it depends on which party rules the country.

Though if it always starts 1 May, then it should be simple to write a
before insert trigger that fills a new field called TAX_YEAR. For
automatic reports, you could regularly run stored procedure that
checked if the current tax year (the tax year of CURRENT_DATE) is more
than one year after the last year for which you've produced your reports.

HTH,
Set

--- In firebird-support@yahoogroups.com, Robin Davis wrote:
> Hi,
>
> This is where I show just how little I know!
>
> In the UK our tax year is 2006/05/01 to 2007/04/30 etc etc. I've
> been able to work out how to do yearly reports by manually entering
> the start and end dates into a query, but is it possible to use
> Firebird's brain to recognize the start and end date of a new tax
> year so the creation of new reports can be automatic? i.e. When the
> clock rolls over from 30th April, 2006 to 1st May, 2006, the DB
> recognizes the fact and starts a new tax year block of analysis.
>
> Guess who's trying to save himself trouble changing the dates for the
> last six tax years to reflect the new tax year? ;-)
>
> Rob Davis