Igor Tandetnik wrote:
> 
> It's simple, really. (WeekNum=53) is a boolean expression, which has a
> value of 1 (for true) or 0 (for false). So Year + (WeekNum=53) is equal to
> Year most of the time, but Year + 1 when WeekNum is 53. Similarly WeekNum 
> - (WeekNum=53)*52 is equal to WeekNum most of the time, but to 1 (53 - 1 *
> 52) when WeekNum is 53.
> 
> It could be written more explicitly:
> 
> GROUP BY Year + (case WeekNum when 53 then 1 else 0 end), 
>     (case WeekNum when 53 then 1 else WeekNum end);
> 
> 

Okay, I get it. GROUP by Year and if week 53 it becomes part of the next
Year. GROUP by WeekNum and if 53 it becomes 1.

Does this effect the Max(High) and Max(Low) values as well? In other words,
will the values of week 53 be part of the equation with week 1 when
returning Max(High) and Max(Low) for the week?

Thanks for your replies. Very educational!

:)

-- 
View this message in context: 
http://old.nabble.com/Converting-Daily-to-Weekly-tp33252969p33258355.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to