Re: [SQL] Week to date function

2010-03-27 Thread Jorge Godoy
It isn't. The norm is defined by ISO 8601. There is a lot of "fun" into date calculations. The rule is to counts the number of Thursdays on a year to get the correct number of weeks. What bothers me more is that here it is cultural that weeks start on Sunday, but ISO 8601 says they start on Mon

Re: [SQL] Week to date function

2010-03-27 Thread Ireneusz Pluta
Jorge Godoy pisze: Are you sure? http://en.wikipedia.org/wiki/ISO_8601 snip As Jan 1st, 2010 happened on a Friday, it was on week 53 of 2009. you are right, thanks for pointing that out. I didn't check the opposite way like this: select date_part('week', '2010-01-01'::date); date_part

Re: [SQL] Week to date function

2010-03-27 Thread Jorge Godoy
Are you sure? http://en.wikipedia.org/wiki/ISO_8601 Week dates Main article: ISO week date *-Www* *or* *Www* *-Www-D* *or* *WwwD* Week date representations are in the format as shown in the box to the right. [] indicates the *I