Need to create a result set that summarizes daily totals for a range of dates and need to include those dates with no activity.
Try this recursive SQL expression to generate a temporary result set with one row for every day of the month, which can then be used as the basis for a query that summarizes daily totals.
with CALENDAR_MONTH(CALENDAR_DATE) AS(
FROM (values('&&YR-&&MN' concat '-01')) x(CALENDAR_DATE)
SELECT CALENDAR_DATE+1 day
WHERE month(CALENDAR_DATE+1 day)=month(CALENDAR_DATE))
Still have questions? We can help. Submit a case to Technical Support.