Share via

set date range to all records on dates parameters

Victor Hache 0 Reputation points
2026-05-28T19:10:12.9933333+00:00

I want to set my date range in parameters to all dates. how can I do that in parameters settings

SQL Server Reporting Services
SQL Server Reporting Services

A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Marcin Policht 92,045 Reputation points MVP Volunteer Moderator
    2026-05-28T19:53:38.66+00:00

    To set a date range parameter to include all dates in SSRS, you can use a query to automatically find the earliest and latest dates in your database. First, create a new dataset in your report that pulls the minimum and maximum dates from your table using a query like SELECT MIN(DateColumn) AS MinDate, MAX(DateColumn) AS MaxDate FROM YourTable. Next, open the properties for your start date parameter, go to the default values tab, choose to get values from a query, and select the minimum date field. Do the same for your end date parameter, but select the maximum date field as the default value instead. This should make the report automatically select the widest possible date range every time it runs.

    Another potential approach is to have date parameters blank. To do this, open the parameter properties for both your start and end dates and check the box that allows null values. Then, must update the main dataset query for your report to ignore the date filter if no date is chosen. You can write your filter clause like WHERE (@StartDate IS NULL OR DateColumn >= @StartDate) AND (@EndDate IS NULL OR DateColumn <= @EndDate).


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.