Dynamic Dates
This solution provides the following four functions that enable the creation of dynamic dates based on an offset value. By using these functions, you can create scheduled report ranges adaptive, as they are evaluated at request time. This means that when a scheduled report is generated, the functions produce different dates each time, resulting in a more dynamic and up-to-date report.
-
NOW(): Returns the current date and time.
-
TODAY(): Returns the current date, with the ability to specify a number of days as an offset.
-
LASTDAYOFOFFSETMONTH(): Returns the last day of the previous month, with the ability to specify a number of months as an offset.
-
FIRSTDAYOFOFFSETMONTH(): Returns the first day of the month, with the ability to specify a number of months as an offset.
-
FIFTEENTHDAYOFOFFSETMONTH(): Returns the 15th day of the month, with the ability to specify a number of months as an offset.
For example, TODAY(-1) means one day before the current date, while FIFTEENTHDAYOFOFFSETMONTH(5) means the 15th day of the month, 5 months from the current month.