Re: Day of the week

From: Luuk <luuk_at_invalid.lan>
Date: Sun, 11 Dec 2016 14:30:00 +0100
Message-ID: <584d54d5$0$21494$e4fe514c_at_news.xs4all.nl>


On 10-12-16 12:45, Daniele wrote:
> Hi,
>
>>> selcet * from Table1 where DayOfWeek(Table1."DATE")=1
>
>> select * from Table1 where DayOfWeek(Table1.DATE)=1 ;
>> perhaps?
>
> No, after searching, reading and understanding i got the soluction !!
> here the correct query for Firbird
>
> Selcet * Table1."DATE" From Table1 Where EXTRACT(WEEKDAY From
> Table1."DATE)=1 and Table1.Year=2016 and Table1.Month=12
>

It's 'SELECT' and not 'Selcet'

Also monday's can be selected in MySQL like this: select current_date, mod(current_date-cast('2016-12-12' as date),7)=0 monday;

Here monday will be 1 on mondays.

In FireBurd casting is noe differently, so you can rewrite it to this: select current_date, mod(current_date - date '2016-12-12',7)=0 monday from test; Received on Sun Dec 11 2016 - 14:30:00 CET

Original text of this message