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

Dynamic Formula in CR 8.5 1

Status
Not open for further replies.

oguraja

Programmer
Jun 14, 2003
124
US
CR 8.5
Hi all,
i need a formula like the below one

if {SalesTable.sale} > 1000 then
Amount := SalesTable.sale;

"Sale" - should decide which field of the recordset has to be used. But i need this to be a variable so that i can change the field name at runtime and use the same formula with different fields.

How can i write a dynamic formula like that??


 
You could create a string parameter {?AmountField} and then change the formula to the following format:

if {?AmountField} = "Sales" then {SalesTable.Sale} else
if {?AmountField} = "Purchases" then {Purchases.Purchase} else
if {?AmountField} = "Discounts" then {Purchases.Discount}

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top