Subject | Re: [firebird-support] Extract weekday |
---|---|
Author | Martijn Tonies |
Post date | 2005-04-19T14:17:49Z |
> >Acording to Helen's book extract weekdays returns values 0..6 (0 isSunday).
> >Could it be somewhere configured, that we get 1..7 (1 is Monday) ?Which means 1 = Sunday, not 1 = Monday.
> >Or maybe aditional approach ?
>
> EXTRACT (WEEKDAY FROM myDate) +1
:-)
Now, wouldn't Stored Functions be nice... :-/
function ExtractWeekday(aDate: DATE): SmallInt
as
begin
returns extract(weekday from aDate - 1) + 1;
end;
Pitty this isn't making it into Fb 2... :-/
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server
Upscene Productions
http://www.upscene.com