RE: Find all the dates in the calendar week?

Поиск
Список
Период
Сортировка
От Karel Zak
Тема RE: Find all the dates in the calendar week?
Дата
Msg-id Pine.LNX.3.96.1000706150155.14481B-100000@ara.zf.jcu.cz
обсуждение исходный текст
Ответ на RE: Find all the dates in the calendar week?  ("Andrew Snow" <als@fl.net.au>)
Ответы Re: Find all the dates in the calendar week?  (Helge Haugland <helland@geocities.com>)
Список pgsql-general
On Thu, 6 Jul 2000, Andrew Snow wrote:

> > 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');

 A small note about 'WW' in to_char/timestamp(), in 7.0 is a small bug
in this code (already discussed) and it is based on standard weeks, but in
7.1 it will *different* and based on weeks like Oracle (already in CVS).

Oracle: first week start JAN-1 and all next weeks start in same day. For
example if first day of year is friday, all weeks start in friday.

ISO-week: week that has more than 4 day and start in Sunday.

In future I try implement 'IW' that is ISO-week, but now I work on different
things.

In current 7.0 is probably better for week operations use
date_part('week', TIMESTAMP) than to_char().

                        Karel


В списке pgsql-general по дате отправления:

Предыдущее
От: The Hermit Hacker
Дата:
Сообщение: Re: PostgreSQL & the BSD License
Следующее
От: Thomas Lockhart
Дата:
Сообщение: Re: change in now() and ago with 7.x