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:tgl@xxxxxxxxxxxxx] > Sent: Tuesday, January 23, 2007 5:40 PM > To: Robert Sanford > Cc: pgsql-general@xxxxxxxxxxxxxx > Subject: Re: [GENERAL] Date Questions > > "Robert Sanford" <rsanford@xxxxxxxxx> 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 >