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!

Need to look in a second table when a record is not in the first table

Status
Not open for further replies.

thethuthinnang

Technical User
Jan 27, 2010
3
US
I am trying to add a field to my report from one of two tables. If the record doesn't exist in the first table I want Crystal to look for it in the second. The result of this formula is a blank report:

If IsNull({arp.due_date}) Then {art.due_date} Else {arp.due_date}

Can I do this with a formula? Both tables are linked as Left Outer Join.

Thanks!
 
Hi,
How are the 2 tables linked in your report?

- which is first ( leftmost)?
- What field links them?




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
The left table is orders_invoice and they are linked with doc_ctrl_num.

I am also experimenting with SQL - UNION but no luck with that yet. I'm really new to Crystal and databases in general.
 
Hi,
something to try:

Use a Right-Outer join between the tables

then use your formula to display that field:
(assuming arp is the left table)
Code:
@showit
If IsNull({arp.due_date}) Then {art.due_date} Else {arp.due_date}

This should be in the detail in place of those 2 database table fields, not used as a record selection criterion.


[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top