Subject Re: [ib-support] days from January the 1st
Author Virat Luevisadpaibul
IF you have UDFLIB you may try
select JULIAN(cast('now' as date)) from rdb$database
to return number of day from JAN-01 of any year.
Virat.
----- Original Message -----
From: Ivan Prenosil <prenosil@...>
To: <ib-support@yahoogroups.com>
Sent: Saturday, March 02, 2002 8:12 PM
Subject: Re: [ib-support] days from January the 1st


> > inside a SP, I need to compute the number of days that have elapsed
since
> > January the 1st of the current year up to a given date (also of the
current
> > year).
> >
> > For now, I have been able to write
> >
> > gg=cast(:d_mov-'2002-01-01' as integer);
> >
> > but the bluff won't last long... :)
>
> EXTRACT (YEARDAY FROM :d_mov)
> or
> EXTRACT (YEARDAY FROM CURRENT_TIMESTAMP)
>
> When used with TIMESTAMP, it works for both 1 and 3 dialects.
> (DATE type can be used only with dialect 3)
>
> Numbers begin with zero (i.e. January the 2nd returns 1 etc.)
>
> Ivan
> http://www.volny.cz/iprenosil/interbase
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>