RE: Find all the dates in the calendar week? - Mailing list pgsql-general

From Andrew Snow
Subject RE: Find all the dates in the calendar week?
Date
Msg-id NHEALMDKDACEIPBNOOOCMEPMCGAA.als@fl.net.au
Whole thread Raw
In response to Find all the dates in the calendar week?  (Stephane Bortzmeyer <bortzmeyer@pasteur.fr>)
Responses Re: Find all the dates in the calendar week?  (Stephane Bortzmeyer <bortzmeyer@pasteur.fr>)
RE: Find all the dates in the calendar week?  ("Andrew Snow" <als@fl.net.au>)
RE: Find all the dates in the calendar week?  (Karel Zak <zakkr@zf.jcu.cz>)
List pgsql-general

> I have a table of events with a column which stores datetimes. I
> want to check
> if a datetime is inside the current calendar week (i.e. from the previous
> monday to the next sunday). The purpose is to SELECT all the
> events of the
> week.

See this posting:

> -----Original Message-----
> Sent: Tuesday, 4 July 2000 6:01 PM
> To: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] number of weeks
>
> -- Week number of the year
> to_char(CURRENT_TIMESTAMP, 'WW');
> -- Day number of the year
> to_char(CURRENT_TIMESTAMP, 'DDD');
>
> See the documentation at:
> http://www.comptechnews.com/~reaster/postgres/functions2976.htm


So, something like:

SELECT event FROM events WHERE to_char(CURRENT_TIMESTAMP, 'ww') =
to_char(eventdate, 'ww');


Regards,
Andrew Snow



pgsql-general by date:

Previous
From: Gilles DAROLD
Date:
Subject: Re: Two questions in a row
Next
From: Gilles DAROLD
Date:
Subject: Re: Two questions in a row