Subject | RE: [firebird-support] Extract weekday |
---|---|
Author | Clay Shannon |
Post date | 2005-04-19T16:14:46Z |
<<
Martijn wrote: >Which means 1 = Sunday, not 1 = Monday.
ROUND 2:
Martijn wrote:
Since it only has to roll Sunday over from 0 to 7, this won't give the
right result either. (Monday is already 1).>>
I thought this "Battle of the FB Giants" was only going to be available via
Pay-Per-View!
Clay Shannon,
Dimension 4 Software
>ROUND 1:
Martijn wrote: >Which means 1 = Sunday, not 1 = Monday.
>Helen wrote: Erp, yes. Subtract 1.
>:-)
ROUND 2:
Martijn wrote:
>Now, wouldn't Stored Functions be nice... :-/Helen wrote:
>
>function ExtractWeekday(aDate: DATE): SmallInt
>as
>begin
> returns extract(weekday from aDate - 1) + 1;
>end;
>
>Pitty this isn't making it into Fb 2... :-/
Since it only has to roll Sunday over from 0 to 7, this won't give the
right result either. (Monday is already 1).>>
I thought this "Battle of the FB Giants" was only going to be available via
Pay-Per-View!
Clay Shannon,
Dimension 4 Software