Avatar of deborahhowson00
deborahhowson00
 asked on

SSRS Return Data from One Dataset where it does not exist in another

Hi, I am using Report Builder 3 on SQL 2008 and am wondering if it is possible to return values in one dataset based on whether the value is present in another dataset.

For example, my first dataset is the one my Tablix is based on and has a list of property references.

My second dataset just pulls through a list of property references that have a certain charge against them.

I don't want to see the properties in my first dataset if they exist in the second dataset?

Many thanks in Advance.
Microsoft SQL ServerMicrosoft SQL Server 2008SSRS

Avatar of undefined
Last Comment
deborahhowson00

8/22/2022 - Mon
Tony303

Does the Query feeding the first dataset have the field that determines that a charge is against the property?

I would just filter your dataset that feeds the Tablix.

OR You could change the first query to include a nested query that excludes the properties with a charge.

Like this.

SELECT *
FROM yourfirstdatasetTable
WHERE ID NOT IN  (SELECT ID FROM yourseconddatasetTable WHERE ChargeOnProperty = 1)

Open in new window

ASKER CERTIFIED SOLUTION
deborahhowson00

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
deborahhowson00

ASKER
I figured out how to do it myself.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23