Summarizing the data on date field

UDA

Summarizing the data on date field

Hi All,

I have a table with one of the field as Point_of_sale DATE. I want to summarize the data in the table from daily to weekly. ( Weekending on Saturday)

How can i achieve this.

Thanks
Nick
1 REPLY
N/A

Re: Summarizing the data on date field

Calculate the weekday using "(datecol - a_known_weekday) mod 7" and substract that.

For weeks ending on saturday it's:
date_col - ((date_col - DATE '0001-01-07') MOD 7)

Dieter