Subject Re: [firebird-support] strange problem with extract(month from "date")
Author Arno Brinkman
Hi Helen,

> >You can't use NULL this way in CASE the only way to test for NULL is :
>
> Arno, this works - why can't it be used?
> Here's a test case you can try on employee.fdb:

Yes, but the example below is different then you wrote in the first message
:-)
I think you thought right, but your fingers where touching the wrong keys on
the keyboard :-))

> SELECT PO_NUMBER, SHIP_DATE,
> (CASE
> WHEN SHIP_DATE IS NULL THEN NULL
> ELSE EXTRACT (MONTH FROM SHIP_DATE)
> END) AS M,
> (CASE
> WHEN SHIP_DATE IS NULL THEN NULL
> ELSE EXTRACT (YEAR FROM SHIP_DATE)
> END) AS Y
> FROM SALES
> WHERE PO_NUMBER IN ('V9346200', 'V9345200');

Greetings,
Arno