Every app has its joyful inconsistencies and learning them is part of
the process...

So if I'm currently doing a GROUP BY date_part(week, datecolumn) in a
view and  I really want to be using the DOW convention I need to write a
customized get_sunday_week_num (date) to make everything consistent. Or,
did someone else run into this problem and solve it before me?

rjsjr

PS - Coming from an MS-SQL Server background I *love* the date
functionality in PostgreSQL.

> -----Original Message-----
> From: Tom Lane [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, January 23, 2007 5:40 PM
> To: Robert Sanford
> Cc: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Date Questions 
> 
> "Robert Sanford" <[EMAIL PROTECTED]> writes:
> > It appears to me that there is some inconsistency in the date 
> > calculations for my PostgreSQL install (version 8.0 on Win32).
> 
> extract(DOW) follows the convention that the week starts on 
> Sunday, but extract(WEEK) uses the ISO convention, which 
> includes weeks starting on Monday.  No, it's not super 
> consistent, but hardly anything about date/time conventions is :-(
> 
>                       regards, tom lane
> 

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to