Trouble Viewing Images? Right-click on any image and select "Open in new tab" to view a larger version. You can also zoom in using Ctrl + Mouse Wheel for easier readability.
Article Goal
Provide a complete reference of reserved words available for use in VDM Date Filters, including their usage and expected results.
What Are Reserved Words for Date Filters?
Reserved Words are special placeholders in VDM that dynamically return dates or date ranges when running views. They are essential for building reusable and automated reports that rely on time-based filtering logic.
Why Use Reserved Words for Date Filtering?
Reserved Words make it easier to:
- Automatically retrieve date values relevant to the current run (e.g., today, last month)
- Minimize user input during runtime
- Build logic that adjusts over time without requiring manual updates
Special Date Filtering Options/Reserved Words
Open an existing view or create a new one. In the Query Builder, locate the FSGS menu to access filtering options.
Select a table column under Field, then choose the desired Operator. In the Value section, select Reserved Word from the dropdown menu. From there, choose Dates, and browse the available options, including both date ranges and single-date values.
Quick Reference — Single Date Parameters
Note: Examples assume a runtime date of July 17, 2025. This section contains Reserved Words that will return a single date value when used in VDM.
| Parameter Pattern | Description | Example |
|---|---|---|
@Date | Current date | '2025-07-17' |
@FirstDayThisMonth | First day of current month | '2025-07-01' |
@LastDayThisMonth | Last day of current month | '2025-07-31' |
@LastDayofLastMonth | Last day of previous month | '2025-06-30' |
| Parameter Pattern | Description | Example |
|---|---|---|
@LastDayXMonthsAgo | Last day of X months ago | '2025-05-31' |
@LastDayXMonthsOut | Last day of X months forward | '2025-09-30' |
@XMonthsAgoStartDate | First day of X months ago | '2025-06-01' |
@XMonthsAgoEndDate | Last day of X months ago | '2025-06-30' |
@XMonthsOutStartDate | First day of X months forward | '2025-08-01' |
@XMonthsOutEndDate | Last day of X months forward | '2025-08-31' |
| Parameter Pattern | Description | Example |
|---|---|---|
@XDaysAgo | Date X days ago | '2025-07-12' |
@XDaysOut | Date X days in future | '2025-07-22' |
| Parameter Pattern | Description | Example |
|---|---|---|
@TodayXYearsAgo | Same date X years ago | '2024-07-17' |
@XYearsAgoStartDate | First day of year X years ago | '2024-01-01' |
@XYearsAgoEndDate | Last day of year X years ago | '2024-12-31' |
@XYearsOutStartDate | First day of year X years forward | '2026-01-01' |
@XYearsOutEndDate | Last day of year X years forward | '2026-12-31' |
| Parameter Pattern | Description | Example |
|---|---|---|
@XQuarterYYearsAgoStartDate | Start of quarter X, Y years ago | '2024-01-01' |
@XQuarterYYearsAgoEndDate | End of quarter X, Y years ago | '2024-03-31' |
@XQuarterYYearsOutStartDate | Start of quarter X, Y years forward | '2026-01-01' |
@XQuarterYYearsOutEndDate | End of quarter X, Y years forward | '2026-03-31' |
| Parameter Pattern | Description | Example |
|---|---|---|
@XWeeksAgoStartDate | Sunday of X weeks ago | '2025-07-06' |
@XWeeksAgoEndDate | Saturday of X weeks ago | '2025-07-12' |
@XWeeksOutStartDate | Sunday of X weeks forward | '2025-07-20' |
@XWeeksOutEndDate | Saturday of X weeks forward | '2025-07-26' |
| Parameter Pattern | Description | Example |
|---|---|---|
@XDayYMonthsAgo | X Day, Y months ago | '2025-05-05' |
@XDayYMonthsOut | X Day, Y months forward | '2025-09-05' |
Quick Reference — Date Range Parameters
Note: Examples assume a runtime date of July 17, 2025. This section contains Reserved Words that will return a date range when used in VDM.
| Parameter Pattern | Description | Example |
|---|---|---|
@ThisMonth | Current month (start → end) | '2025-07-01' → '2025-07-31' |
@LastMonth | Previous month | '2025-06-01' → '2025-06-30' |
@ThisYear | Current year | '2025-01-01' → '2025-12-31' |
| Parameter Pattern | Description | Example |
|---|---|---|
@XWeeksAgo | Full week X weeks ago (Sun–Sat) | '2025-06-29' → '2025-07-05' |
@XWeeksOut | Full week X weeks forward | '2025-07-27' → '2025-08-02' |
| Parameter Pattern | Description | Example |
|---|---|---|
@XMonthsAgo | Entire month X months ago | '2025-02-01' → '2025-02-28' |
@XMonthsOut | Entire month X months forward | '2025-09-01' → '2025-09-30' |
| Parameter Pattern | Description | Example |
|---|---|---|
@XYearsAgo | Entire year X years ago | '2023-01-01' → '2023-12-31' |
@XYearsOut | Entire year X years forward | '2027-01-01' → '2027-12-31' |
| Parameter Pattern | Description | Example |
|---|---|---|
@XQuarterYYearsAgo | Quarter X, Y years ago | '2023-07-01' → '2023-09-30' |
@XQuarterYYearsOut | Quarter X, Y years forward | '2027-07-01' → '2027-09-30' |
Comments
2 comments
Is there any way to parse the date for a number or character field. For example... I have a stats table (Cache) that has a Stat Month and a Stat Year. So I need to take last month's date and parse it... I can use the Cache commands it seems but I need to know how the @LastMonth is laid out if I'm going to try to parse the date to fill the Stat Month (character field) and State Year (number field). Thanks!
Hello Jeremy, to leverage the Special Date Filtering options you would need to apply the filter against a date field. You can create a date field using Stat Month and Year by creating a custom database field/function in VDM using the following example:
{fn CONVERT(STRING(SQLUser.Clnt_Stats_MTD.FOUR_DIGIT_YEAR,'-',SQLUser.Clnt_Stats_MTD.STAT_MONTH,'-','01'),SQL_DATE)}
Please reference ticket 13188 for more information.
Please sign in to leave a comment.