Solved

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

Posted on 2013-06-21
4
579 Views
Last Modified: 2013-06-21
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
Comment
Question by:jbrazie
  • 2
4 Comments
 
LVL 26

Accepted Solution

by:
Kurt Reinhardt earned 500 total points
ID: 39266366
Left outer join the tables and put ISNULL(PATIENT_NAME) in your record selection criteria
0
 
LVL 18

Expert Comment

by:vasto
ID: 39266401
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
 
LVL 18

Expert Comment

by:vasto
ID: 39266461
I had to refresh before to post this.  rhinok's post said everything
0
 

Author Closing Comment

by:jbrazie
ID: 39266593
So simple when you put it that way...

It worked perfectly thank you so much! Rhinok you are the MAN (or woman)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now