Subject RE: [firebird-support] Re: select birthdays form the next several days
Author Cao Ancoinc
What about using the dob year

select dob from ordtrn
Where ((Current_Date+14) -
(Cast (Extract(Year from Current_Date)||'-'|| Extract (Month from
dob)||'-'|| Extract (Day from dob) as Date)))
between 1 and 14

Reagrds Cao

> -----Original Message-----
> From: firebird-support@yahoogroups.com
> [mailto:firebird-support@yahoogroups.com]On Behalf Of Ian A. Newby
> Sent: 23 September 2005 02:32
> To: firebird-support@yahoogroups.com
> Subject: [firebird-support] Re: select birthdays form the next several
> days
>
>
> How about
>
> select birthday from persons
> where mod((current_date - birthday) / 365.25) < (14 / 365)
>
> you'll need a MOD udf though.
>
> It may be a bit inaccurate, but should be nearly there.
>
> regards
> Ian Newby
>
>
>
>
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> 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
>
>
>
>
>
>
>
>