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

Reply via email to