On Mon, Sep 30, 2002 at 06:49:34PM -0400, Tom Lane wrote:
| The other issue is what
| to_date(...,'WWYYYY') should do to produce a date representing a week
| number.  Shouldn't it always produce the first date of that week?
| If not, what other conventions make sense?

IMHO, it should choose the "Week Ending" date.  This is
usually what all of the companies that I've worked with
want to see for the "day" column.  For example, the 
defect^H^H^H^H^H^H quality reports at Ford Motor in 1993
used a Predo of part by defect by week-ending.  Where
week ending date was the Sunday following the work 
week (monday-sunday).   In various project data in
companies that I've worked with before and after 1993
I've yet to see a "weekly" report that didn't give
the week ending... alhtough some did use Friday or
Saturday for the week ending.

One hickup with this choice is that you'd probably 
want the time portion to be 23:59:59.999 so that it
includes everything up to the end of the day.  Hmm.

Clark

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Reply via email to