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!

Link tables on one or another field 1

Status
Not open for further replies.

up4a

Technical User
Apr 27, 2010
19
US
I am using Crystal X with an ODBC connection.

I am trying to link a CUSTOMER table to a PRICING table on one of two possible fields,

The customer Number or the pricing Level. One or the other will match in the pricing table for each customer.

I have used a left join FROM the Customer TO the Pricing and selecting off the Customer table. No records are returned.

I have successfully written a separate report for either instance but would prefer one report for any customer selection.

Any suggestions would be great!
 
Hi,
If you link by both fields in the Linking expert, then BOTH would have to match to return a record and no record probably meets that test so no records are returned.

Links are set when designing the report and I do not know of a method of changing them through user input or formulas.

If you use a Command, you may be able to pass the linking field desired by use of a parameter but, even then, only one field could be linked for the report without having the same issue.


[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
I can change the links by selecting the database menu, database manager and the links tab.

With a left join it should include any data selected in the FROM table and only that that links in the TO table
 
Hi,
Are you saying that with only one linked field you are still getting no data?



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
I think you should add the Pricing table a second time. On one, just link to the customer field, and on the other, the other field. Both of these should be added with a left join.

I'm a little fuzzy on the second possible link--you say it could match on the pricing field--why would there be a pricing field in the customer table?

-LB
 
lbass,

I had the same thought once I slept on it. I can get it to select the data now from the customer file and can hopefully complete the report with two sub-reports.

I have to remind myself to step away from a project sometimes!

(The second link is a pricing level in the customer file, so a customer is at a certain level that ties to the pricing file by item)

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top