Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table Joins

Status
Not open for further replies.

AAKissinger

Technical User
Dec 5, 2010
4
US
I am new to Crystal Reports and could use help. I have two excel tables joined by an inner join to a field common in both tables. One table is a master list of all active med programs; the second table lists specific meds ordered by a specific facility. The result I need is to have my facility data return with the matching active program from the master list. Not all records from the facility table will find a corresponding record from the master table and should result in a shorter list. Currently I am getting the complete facility table of data to print and that is not correct. This should be simple? Thank you for your help.
 
Hi,
depending on the field that is linked, if you link
Master --> Facility
with an Equi ( Inner) Join then only those records where both tables have an entry should be returned.

If this is not the case, can you post the SQL code generated by CR for your report?





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Hi Turkbear -

Thank you for such a speedy response! I am still not getting the expected return for data. This is a sample of what I am lloking at:

The facility table has data
NDC # Med
00123 Abilify
00124 Abilify
00125 Abilify
00126 Abilify

Master Table has data
NDC# Med
00123 Abilify
00125 Abilify
00128 Abilify
00130 Abilify
00135 Abilify
00140 Abilify

The return I need is for the facility table to look at the master table and return
NDC# Med
00123 Abilify
00125 Abilify

The common field in both tables is the NDC field which I tried the inner join but I do not get the results I need.
 
Hi Turkbear -

I did preface with "I am New" to Crystal Reports. I figured out I can get the needed reults with how I lay out the fields in the report and your advice worked great! I'm set now and will be purchasing a book on reporting tomorrow.:)
 
Hi,
Glad you got it working..Enjoy learning, and look online for great tips and maybe even some tutorials.

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
I think the issue is that you must have fields from both tables used in the report in order to enforce the joins. Otherwise (if you are not showing fields from each table) you have to explicitly check "enforce both" in the database expert->link options.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top