Range parameters are used to choose a range of values. Let's say we would like to see data between two dates. We can create two parameters StartDate and EndDate.
The query to create date range parameters is shown below
SELECT FName ,LName ,SaleAmt FROM dbo.TotalSale WHERE SaleDate BETWEEN @StartDate AND @EndDate
We often use Range Parameters and configure them with default values to show records e.g
- Get records from start of the year to date
- Get records from start of month to date
- get all records for current quarter etc.
No comments:
Post a Comment