Subject | Re: [ib-support] days from January the 1st |
---|---|
Author | Ivan Prenosil |
Post date | 2002-03-02T13:12:14Z |
> inside a SP, I need to compute the number of days that have elapsed sinceEXTRACT (YEARDAY FROM :d_mov)
> 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... :)
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