Subject RE: [firebird-support] Subtract Years from a Date Value in SQL
Author Si Carter
-----Original Message-----
From: Martijn Tonies [mailto:m.tonies@...]
Sent: 01 March 2005 16:26
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Subtract Years from a Date Value in SQL


> > Perhaps it would be better to write an UDF in which you decode the
> > date, subtract 100 years and encode it again. That way, the leap
> > years are included.
>
> Yeah, but if the date is a 29.02., you would also have to check if the

> calculated year is also a leap year (e.g. 29.02.2000 minus 100 years
> -> 28.02.1900 ?)

Not sure if they would help but have a look at some of the stored procs
on
this page
(http://www.volny.cz/iprenosil/interbase/ip_ib_code_timestamp.htm)

Rgds

Si Carter
http://www.tectsoft.net/