Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Get last full 20 weeks with function ADD_MONTHS(date - EXTRACT(day FROM date) +0, 0) - response (1) by dnoeth

$
0
0

This will calculate the previous monday (when your week starts on sunday change to DATE '0001-01-07'):

datecol - ((datecol - DATE '0001-01-01') MOD 7)

And now it's easy to substract 20*7 days :-)
 
Dieter


Viewing all articles
Browse latest Browse all 14773

Trending Articles