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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Matching Records from Seperate Tables 1

Status
Not open for further replies.

byrne1

Programmer
Aug 7, 2001
415
US
I am writing a report that shows all items in TABLE1 and their corresponding alternate item in TABLE2. Most, but not all, items in TABLE1 will have a corresponding record in TABLE2. Both tables are linked by the ITEMNUM field. My report basically looks like this:

TABLE1.ITEMNUM TABLE2.ALTNUM

I've tried both left outer join and right outer join in the Visual Linking Expert but I have not gotten the results I need (in both cases the AltNum field is always blank). If I set the join to be equal to then it only shows me the ITEMNUM fields that have a corresponding record in TABLE2.

I am running CR 7.0.
 
If in the Linking Expert you have them this way:

[table1]------>[table2]

then a Left Outer Join should return any matching table2 records and all table1 records...

Have you tested to be sure the linked fields actually match?
Can you access table2 alone with the same user account?
If you only place a field from table2 on the report, do you get any data.?

Which version of Crystal and What database?



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
A Left Outer is correct.

Either the data is different than you imagine, or you're not using a Left Outer.

It's a Left Outer from Table1 to Table2.

Don't put anything in the record selection formula->record (or select expert) for the table2.

You might consider fortifying your posts with technical information:

Database/connectivity used
Example data
Expected output

Also post what's in the Report->Edit Selection Formula->Record

You may find that you are preventing it from returning the rows in there.

-k
 
Also, any join is based on the sequence in which you placed the tables into your report. And goes from left to right.

So if you placed TABLE 1 into your report FIRST and then added TABLE 2, then you can LEFT OUTER JOIN from Table 1 to 2 and your report should return ALL of the data from table 1 and ONLY items from table 2 that match the linking data element.

They key is the sequence that these tables where placed.

Thanks:
Mike Vega

"What would you attempt to do... if you knew you could NOT fail?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top