fiscal_week_last_day({date})

Accepts a DateTime, DateOnly, or legacy Date object as input. Returns an object of the same type that corresponds to the last day (Sunday) of the fiscal week that contains the specified date.

Example 

1SELECT OrderDate as "date", fiscal_week_last_day(OrderDate) as "fiscal_week_last_day" FROM "dates_sample_data";
datefiscal_week_last_day
2015-01-21 15:30:002015-01-25 00:00:00
2015-01-21 00:00:002015-01-25 00:00:00
2015-01-31 10:00:302015-02-01 00:00:00
2015-02-03 15:30:002015-02-08 00:00:00
2016-01-21 23:59:592016-01-24 00:00:00
2015-10-31 23:59:592015-11-01 00:00:00
2015-12-03 00:00:002015-12-06 00:00:00
2016-01-11 03:30:002016-01-17 00:00:00
2016-01-11 03:30:002016-01-17 00:00:00