Subject Re: [ib-support] how get the current year
Author Ivan Prenosil
> I need get current year
> 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"

1) instead of 'today' it is better to use CURRENT_DATE,
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