Subject Re: [firebird-support] Caculating specific dates for each year
Author Werner F. Bruhin
Hi Robin,

I don't know but why would you care about this on the DB level. Just
because the tax year changes that does not mean that you past
transaction dates change, no?

Isn't it more a problem for whatever tool you use to query the database?
If yes then the query just needs to ask the user what tax year they
are interested in e.g. 2006 and you have somewhere a definition what
month and date it starts (maybe in the database table storing
preferences ....) and then you take 2006 plus the start month/day and
then add 1 to the year and use that with the end month/day.

I use Python so to do the date stuff one could do something like this:
>>> taxyear = '2006'
>>> taxyear = 2006
>>> start = '05/01'
>>> end = '04/30'
>>> begin = str(taxyear) + '/' +start
>>> end = str(taxyear +1) + '/' + end
>>> begin
'2006/05/01'
>>> end
'2007/04/30'

And then feed the "begin" and "end" variables to whatever reporting tool
you use.

Or you might feed just the tax year to the reporting tool and do this
little calculation in the reporting tool.

Hope this helps
Werner


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
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://firebird.sourceforge.net and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>
>
>
>
>
>