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

Variable & as a parameter - CRXI 1

Status
Not open for further replies.

CrystalLion

Programmer
Jan 3, 2007
113
US
I am trying to create a parameter that allows the user to filter items displayed based on a minimum variance percent.

My variance formula is:
if {Inventory_Status.Last_PO_Cost}= 0 then 0 else {Inventory_Status.Last_PO_Cost}/{Inventory_Status.Total_Standard_Cost}-1

So, for example, if the user enters 15 in the report selection prompt, the report would show all items with variances = > 15%. (NOTE-I would like this to include both positive and negative variances.)

My Report Selection line is:
{@Variance %}=> {?Variance % }
where {?Variance % } is a number

Everytime I try to run the report, I get
"A number, currency amount, boolean, date, time, or string is expected here."

What am I doing wrong?
 
This should work. Unless {@Variance %} can be null. Try:

if isnull({Inventory_Status.Last_PO_Cost}) or
{Inventory_Status.Last_PO_Cost}= 0 then
0 else
{Inventory_Status.Last_PO_Cost}/{Inventory_Status.Total_Standard_Cost}-1

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top