Thread: Select 'Sunday' in month ??

Select 'Sunday' in month ??

From
Tubagus Nizomi
Date:
i want to select date in january where day='Sunday'

any idea ??

please help me

Nizomi


Re: Select 'Sunday' in month ??

From
"tjk@tksoft.com"
Date:
E.g.

create table mytable (created datetime);
insert into mytable values ('01-01-2001');
...
insert into mytable values ('01-31-2001');

select created from mytable where date_part('dow', created) = 7 and date_part('month', created) = 1;


Troy

> 
> i want to select date in january where day='Sunday'
> 
> any idea ??
> 
> please help me
> 
> Nizomi
> 



Re: Select 'Sunday' in month ??

From
Karel Zak
Date:
On Wed, 17 Jan 2001, tjk@tksoft.com wrote:

> E.g.
> 
> create table mytable (created datetime);
> insert into mytable values ('01-01-2001');
> ...
> insert into mytable values ('01-31-2001');
> 
> select created from mytable where date_part('dow', created) = 7 and date_part('month', created) = 1;
> 
This will faster (one function call instead two):
..... where to_char(created, 'D/MM') = '7/01';
            Karel