Subject Re: [firebird-support] Extract weekday
Author Martijn Tonies
> >Acording to Helen's book extract weekdays returns values 0..6 (0 is
Sunday).
> >Could it be somewhere configured, that we get 1..7 (1 is Monday) ?
> >Or maybe aditional approach ?
>
> EXTRACT (WEEKDAY FROM myDate) +1

Which means 1 = Sunday, not 1 = Monday.

:-)

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