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!

How To Display Conditional Results - Crystal Reports

Status
Not open for further replies.

AnilJ

Technical User
Jul 28, 2011
8
CA
Hello.
Have a question that may or may not be doable within Crystal.

I have 3 different records within a database and I want to display information only if it meets my condition.

So for example, the records are invemail, salesemail, faxnumber in database AREMAIL.

I would like to have a formula that will look at the first record (invemail) and if there is an email in there (*@* format, because sometimes there are just words in there that I don't want to see, only an email) display it, if not, then look in salesemail, if an email is in there (again in the format of *@*) display it, if not then display what is in the record faxnumber.

So hopefully the formula will know that if it finds an email in the first record it will display that one only and stop there, even though there may be an email within the second record and a fax number in the 3rd.

I hope that makes sense.

Any help with this would be appreciated, if it is possible.

Thank you very much for your time,
AJ


 
Create a formula like this:

[Code email]
If {Table.invemail} like '*@*'
Then {Table.invemail}
Else
If {Table.salesemail} like '*@*'
Then {Table.salesemail}
Else {Table.faxnumber}
[/Code]

Cheers
Pete
 
Hi Pete,

Thank you very much for the formula, it worked out perfectly for me (I just needed to change the faxnumber record to a totext to get it to display) but your help was just what I needed to get it to work.

Thanks again for your time and help.

Regards,

AJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top