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!

Displaly two different field values into one field - Cryst. Rep v8.5 1

Status
Not open for further replies.
Feb 6, 2008
4
US
Using Crystal Reports v8.5, I have two different field values that need to be displayed under one Net Sales column/field.

Specifically, I have one field that contains company sales (e.g.: tbl1.compsalesfield)and another field that contains franchise sales (e.g.: tbl2.frsalesfield). If I want to display either sales values from the mentioned tables under one column (into one 'Net Sales' field), I assume in order to display either value from either tbl1 or tbl2 into one column/field, I'd have to insert a new field object that is defined as a formula field?

If so what should my formula be? I'm not very familiar with Crystal Report syntax and not sure how to construct such a formula.

Any suggestions would be greatly appreciated!!
 
Please clarify: Do you want to display one or the other conditionally? Or do you want to display both?

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
How would these two fields currently display if placed in the detail section? Should these be added together? If so, you could use a formula like:

{tbl1.compsalesfield} + {tbl2.frsalesfield}

-LB

 
Separated by space:
Code:
{tbl1.compsalesfield} & " " & {tbl2.frsalesfield}
Or each on a different line:
Code:
{tbl1.compsalesfield} & Chr(13) & {tbl2.frsalesfield}
In the second case the field should be formatted as Can Grow.


-------------------------------------------------------------------------------------------------------------------------
"Now I can look at you in peace; I don't eat you any more." Franz Kafka, while admiring fish in an aquarium
 
Thanks very much for all the feedback. To answer some of your questions, I'm trying to get both Company sales and Franchise sales to display but not sum or concatinate them. Instead, when it's Company sales, it should display in the Net Sales field and when it's Franchise sales, it should display in the same Net Sales field.

At first, I tried putting both the cosalesfield and frsalesfields under the Net Sales column but when company sales displayed, the franchise sales field showed 0.00 and vise versa. This looks ridiculous and I was trying to get either sales to display in one field.

Hope this clarifies my intent. Once again, your comments were very helpful and much appreciated!!!
 
The issue is that they are appearing in different records. Do you have a field that defines whether the company is a franchise or not? You could possibly handle this like this:

if not isnull({tbl1.company}) then
{table.companysales} else
if not isnull({tbl2.franchise}) then
{table.franchisesales}

It might help to see some sample data with {table.fields} labeled.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top