Subject | Re: [firebird-support] Re: DayOfWeek equivalent |
---|---|
Author | Richard Wesley |
Post date | 2006-05-22T16:44:48Z |
On May 21, 2006, at 23:25, Adam wrote:
(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
> select extract(weekday from current_date)+1 from RDB$DATABASE;Don't forget to check for NULLs with real data:
>
> (the +1 is just so it returns the same as Delphi 1-7 instead of 0-6)
(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