Subject Re: DayOfWeek equivalent
Author Adam
--- In firebird-support@yahoogroups.com, "Adam" <s3057043@...> wrote:
>
> Hi Group,
>
> Is there are an equivalent function or way of doing the Delphi
> DayOfWeek function without UDFs within Firebird?
>
> For those not familiar with Delphi, it accepts a date or timestamp and
> returns
>
> 1 if Sunday
> 2 if Monday
> 3 if Tuesday
> ....
> 7 if Saturday
>
> Perhaps there is some Extract command for the DOW that I can use in a
> simple stored procedure.
>

OK, nevermind I found it:

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)

Adam