Subject | Re: [ib-support] how get the current year |
---|---|
Author | Ivan Prenosil |
Post date | 2001-12-12T13:36:48Z |
> I need get current year1) instead of 'today' it is better to use CURRENT_DATE,
> I do this:
> SELECT 'TODAY' FROM RDB$DATABASE INTO :MY_TODAY
> How can I use extract funtion to extract the year?
> I try
> SELECT EXTRACT(YEAR FROM 'TODAY') FROM RDB$DATABASE INTO :MY_YAR
> but i receive a error message "Specified EXTRACT part does not exist
> in input datatype"
or better yet CURRENT_TIMESTAMP (because it works with both idalects 1 and 3)
2) in stored procedure you do not have to use RDB$DATABASE
====
This should work:
MY_YEAR = EXTRACT(YEAR FROM CURRENT_TIMESTAMP);
====
Ivan
http://www.volny.cz/iprenosil/interbase