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

Formula or Select Expert?!! 1

Status
Not open for further replies.

bamitts

Technical User
Nov 18, 2001
12
US
I hope this is a very easy fix for those of you who regularly use Crystal Reports...

I am using Crystal reports 8.5. I am trying to take one instance of a field and create a new field for it. For an Example: Put all Earning codes, including the hours and $$ amount associated with it in this report.

Earning Code Hours Amount
xxxxxx xx $$$$$

BUT if the earning code is 5, put the amount in a seperate amount column.

Earning Code Hours Amount Earning Code 5
xxxxxxx xx $$$$$ $$$$$$

(I'm not sure of the specific "lingo" to describe this, so thought a visual would help!)

I used the select expert to only choose earning codes that are not equal to 5. I anticipated using a formula to create a new field for all $$ amount for only earning code 5 and place this in the report...but I'm drawing a blank!

Is this the best way to do this? Any suggestions would be appreciated!
 
You should not use any criteria based on earning code in the select expert. Instead, create a formula {@code5}:

if {table.earningcode} = 5 then {table.amount}

You can insert summaries on this as necessary. If you want your other amount column to exclude amounts when the code equals 5, then create a second formula {@notcode5}:

if {table.earningcode} <> 5 then {table.amount}

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top