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
Learn how to set and use default values for Date Time Picker (DTP) parameters in VDM using reserved words.
What is a Default Value?
A Default Value is a pre-populated value in a parameter field before the view is run. This allows users to execute the view without manual input, saving time when parameter changes are not needed.
Why Use Default Values?
Setting a default value streamlines the user experience by allowing views to run with preset logic. This is especially useful for scheduled views or frequently repeated queries.
Note: For Date Time Picker (DTP) parameters, default values must use reserved words. Only single-date reserved words are supported.
Supported Single Date Reserved Words
Below are valid Reserved Words for Default Values in DTP parameters. Replace X or Y with numeric values as needed:
| Reserved Word | Description |
|---|---|
@Date |
Today’s date |
@FirstDayThisMonth |
First day of the current month |
@LastDayThisMonth |
Last day of the current month |
@LastDayofLastMonth |
Last day of the previous month |
@LastDayXMonthsAgo
|
Last day of X months ago |
@XDaysAgo
|
X days in the past |
@XDaysOut
|
X days in the future |
@XDayYMonthsAgo
|
Specific day X of a month Y months ago |
@XDayYMonthsOut
|
Specific day X of a month Y months in the future |
For more on Reserved Words, refer to the Special Date Filtering article.
Video Tutorial
Steps to Use Default Values in a DTP Parameter
Step 1: Open the Parameters Tab
Navigate to the Parameters tab in your view and click Add Parameter.
Step 2: Select Parameter Type
Set the Type to Date Time Picker.
Step 3: Set Datatype
Choose DateTime as the Datatype.
Step 4: Enter a Reserved Word as the Default Value
In the Default Value field, enter one of the supported reserved words from the list above.
Example:
Use @Date to set the default to today’s date.
Important:
Default values only support single-date reserved words. Do not use ranges or compound logic.
Example Output
Parameter Default: @Date
When the view is run, the parameter automatically defaults to today’s date without requiring manual selection.
Article Summary
This article explained how to set Default Values using Reserved Words in Date Time Picker (DTP) parameters. Default values allow for a streamlined view execution, especially useful in scheduled or repetitive view scenarios. Only single-date Reserved Words are supported for this functionality.
Comments
0 comments
Please sign in to leave a comment.