report on specific data range AND specific account number in dropdown parameter

  • Hi everyone!

    Im new to SSRS and have recently built a SQL Server 2012 DB including a table that has all fields I wish to report on.

    I have successfully created some basic reports in SSRS using Report Builder.

    What Im looking to report on is a specific Account field, PlanPaid field, and date field. Easy. I have created a parameter that gives me the date range option (@startDate, @enddate), as well as a parameter that gives me a client drop down menu (@account with available values pointed to the account field for the dataset below) to select the appropriate client. All working

    However, when I choose a date range and client, I’m returned the “total YTD/lifetime PlanPaid amount for the Account” not the PlanPaid amount just for the specific date range I selected.

    I have two datasets, one dataset has the account field, using this query:

    SELECT Distinct

    ClaimDetail.Account

    FROM

    ClaimDetail

    ORDER BYClaimDetail.Account

    The other dataset has the amount and account fields….this particular dataset has a WHERE statement:

    SELECT DISTINCT

    ClaimDetail.PlanPaid

    ClaimDetail.Count

    ClaimDetail.Account

    FROM

    ClaimDetail

    WHERE (ClaimDetail.Account = @account)

    Does anything stick out that I should change or try? What am I missing?

    Thanks!!

    J

  • You need to include your date parameters in the WHERE clause of the appropriate dataset query e.g.

    SELECT DISTINCT

    ClaimDetail.PlanPaid

    ClaimDetail.Count

    ClaimDetail.Account

    FROM

    ClaimDetail

    WHERE (ClaimDetail.Account = @account)

    AND ClaimDetail.PlanPaid BETWEEN @startDate AND @endDate

    Assuming that PlanPaid is the date field that you want to filter on.

  • Thnaks Jon, it works....so easy!!!!

    J

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply