Subject Re: [firebird-support] Re: DayOfWeek equivalent
Author Richard Wesley
On May 21, 2006, at 23:25, Adam wrote:

> select extract(weekday from current_date)+1 from RDB$DATABASE;
>
> (the +1 is just so it returns the same as Delphi 1-7 instead of 0-6)

Don't forget to check for NULLs with real data:

(CASE WHEN <expr> IS NULL THEN CAST(NULL AS SMALLINT) ELSE 1 +
EXTRACT(WEEKDAY FROM <expr> ) END)

________________________________________________________
Richard Wesley Software Engineer
Tableau Software
http://www.tableausoftware.com/ hawkfish
tableausoftware com