Subject Re: using extract on null values
Author Adam
--- In firebird-support@yahoogroups.com, "Christian Kaufmann"
<ch.kaufmann@...> wrote:
>
> Hi,
>
> I have the following query:
>
> select distinct SR.COURSE, R.GENDER as RELAYGENDER, A.GENDER,
> extract(year from A.BIRTHDATE) as YOB
> from SWIMRESULT SR
> left join ATHLETE A on SR.ATHLETEID = A.ATHLETEID
> left join RELAYINFO R on SR.ATHLETEID = R.RELAYINFOID
>
> For records in SWIMRESULT where I have no record in ATHLETE, I get an
> error because "extract(year from A.BIRTHDATE)" fails.
>
> Is there a way, to get null or another default value for YOB in this
case?

What version of FB are you using?

I get null on 1.5.3 when I try to extract from a field with a null value.

From memory, TFB says otherwise.

Adam