Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Date Parameters ignored on SSRS

(0) ShareShare
ReportReport
Posted on by 190

Hi 

I am having trouble with SSRS reports I have 2 date field parameters and when i run the report it ignores the 2 dates i input and displays all the records. I want it to only show me records where the sab_enddate is within 2 dates.

WHERE (ST.sab_shortcode LIKE 'SB%') AND (SP.sab_enddate BETWEEN @EndDateFrom AND @EndDateTo)

Dataset 1: 

SELECT COUNT(*) AS ContactCount, ST.sab_shortcode AS ShortCode, C.sab_Address1_CountryIdName AS Country from Filteredsab_subscriptionplan SP INNER JOIN Filteredsab_subscriptiontype ST
ON SP.sab_subscriptiontypeid = ST.sab_subscriptiontypeid INNER JOIN FilteredContact C ON
C.ContactId = SP.sab_primarycontactid
WHERE ST.sab_shortcode like 'SB%'
GROUP BY C.sab_Address1_CountryIdName, ST.sab_shortcode

Dataset 2: (WHICH HAS THE PARAMETER)

SELECT SP.sab_name AS Subscription, SP.sab_startdate AS SDate, SP.sab_enddate AS EDate, ST.sab_name AS SubscriptionType, ST.sab_shortcode, C.fullname, C.sab_address1_countryidname
FROM Filteredsab_subscriptionplan AS SP INNER JOIN
Filteredsab_subscriptiontype AS ST ON SP.sab_subscriptiontypeid = ST.sab_subscriptiontypeid INNER JOIN
FilteredContact AS C ON C.contactid = SP.sab_primarycontactid
WHERE (ST.sab_shortcode LIKE 'SB%') AND (SP.sab_enddate BETWEEN @EndDateFrom AND @EndDateTo)

*This post is locked for comments

  • Suggested answer
    RE: Date Parameters ignored on SSRS

    I always tried my best to stick to only one main dataset when trying to develop a SSRS report. By doing this it gives me the flexibility to remove the criteria from the report and pushing the criteria to the users by giving them the control of pre-filter (they can set whichever date they want).

  • Verified answer
    Shane Brown Profile Picture
    Shane Brown 190 on at
    RE: Date Parameters ignored on SSRS

    Fixed by scrapping the second Dataset

  • joman Profile Picture
    joman 617 on at
    RE: Date Parameters ignored on SSRS

    The only way, i see, is open SQL server profiler, and find there a query, when SSRS builds Report.

    Then you can find out what is happens.

  • Shane Brown Profile Picture
    Shane Brown 190 on at
    RE: Date Parameters ignored on SSRS

    It works in Management Studio when i set the dates but in the report it does not work.

  • Gopalan Bhuvanesh Profile Picture
    Gopalan Bhuvanesh 11,401 on at
    RE: Date Parameters ignored on SSRS

    Hi

    Do you get the right records if you run the query (with the same date range) in MSSQL Management studio?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,432 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans