You can create a date range filter in VDM by using Start Date and End Date parameters with FSGS.
This allows users to enter a beginning and ending date when running a View and limits the results to records within that range.
Open Parameters
- Open the View in VDM.
- Select Parameters under Query Builder.
- Select Add Parameter to create a new parameter.
Parameters workspace in VDM.
Create the Start Date and End Date Parameters
Create two parameters:
- StartDate
- EndDate
Configure each parameter as a date parameter.
For each parameter:
- Set Type to Date Time Picker.
- Set Datatype to DateTime.
- Set Date Time Picker Type to Date.
- Enter the applicable parameter name.
The parameters can then be used as values in the FSGS filter.
Save Parameters to the Parameter Library
VDM includes a Parameter Library that allows parameters to be saved and reused in other Views.
After creating the StartDate and EndDate parameters, you can save them to the Parameter Library for reuse in other Views.
For complete instructions on saving and reusing parameters, see Using the Parameter Library in VDM.
Date parameter configuration and reusable parameters stored in the Parameter Library.
Create the Date Range Filter in FSGS
After creating the parameters:
- Select FSGS under Query Builder.
- Select the date field you want to filter.
- Create the first filter condition:
- Operator: Greater than or equal to
-
Value:
?StartDate?
- Add a second condition for the same date field.
- Configure the second condition:
- Operator: Less than or equal to
-
Value:
?EndDate?
- Set the conditions to And.
- Make sure both conditions are enabled.
The resulting filter follows this format:
DateField >= ?StartDate? AND DateField <= ?EndDate?
Date Range Filter Example
In the example below, the Employees.BirthDate field is filtered using the StartDate and EndDate parameters.
Employees.BirthDate >= ?StartDate?Employees.BirthDate <= ?EndDate?
FSGS date range filter using the StartDate and EndDate parameters.
When the View is run, the user can enter the desired Start Date and End Date and the results will be limited to records within that date range.
Comments
0 comments
Please sign in to leave a comment.