• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 590
  • Last Modified:

Crystal Reports: Using right table as a filter to left table data

I have two tables joined in my report.  The Left table contains all the data elements (fields) I want to display in my report.  The right table contains a list of data (a single field) with values matching some of the entries in left table for the linked field (PATIENT_NAME).

I would like to display all PATIENT_NAME entries NOT found in the right table. essentially using the right table as a list of PATIENT_NAME entries to filter out of the report.  If the name exists in the right table I do not want that name displayed on the report.

How can I best accomplish this request?

Thnaks,
0
jbrazie
Asked:
jbrazie
  • 2
1 Solution
 
Kurt ReinhardtSr. Business Intelligence Consultant/ArchitectCommented:
Left outer join the tables and put ISNULL(PATIENT_NAME) in your record selection criteria
0
 
vastoCommented:
Use Left join and put in the where clause check for PATIENT_NAME = null

the corresponding SQL will look like this:

SELECT t1.*
FROM Table1 t1 LEFT HOIN Table2 t2 ON t1.PATIENT_NAME=t2.PATIENT_NAME
WHERE t2.PATIENT_NAME is null
0
 
vastoCommented:
I had to refresh before to post this.  rhinok's post said everything
0
 
jbrazieAuthor Commented:
So simple when you put it that way...

It worked perfectly thank you so much! Rhinok you are the MAN (or woman)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now