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!

Crystal Reports formula limiting data

Status
Not open for further replies.

MKouba

Technical User
May 18, 2016
2
US
I am using the below formula in order to pull specific values from my tables. However, When I use the If InStr portion of the formula, the data is then limited to only items that include 'BLK'. How do I get the data to only do the first line if the 'BLK' is true? Otherwise return the normal data results.

If InStr({Material_Req.Material},'BLK')>0 Then ({Material_Req.Est_Qty}*{User_Values_1.Numeric1})/{Job.FG_Transfer_Qty} else
If {Job.FG_Transfer_Qty} <>0 Then {Material_Req.Act_Qty}/{Job.FG_Transfer_Qty}
 
Which version of Crystal are you using?
I find there are times when Crystal does strange things, such as ignoring the else. When that happens I reverse the formula


If InStr({Material_Req.Material},'BLK')=0 Then If {Job.FG_Transfer_Qty} <>0 Then {Material_Req.Act_Qty}/{Job.FG_Transfer_Qty} else ({Material_Req.Est_Qty}*{User_Values_1.Numeric1})/{Job.FG_Transfer_Qty}
 
I am using 10.0.0.533 I tried your formula, however it gives me the same result. I drop from 22 page report to just the items that include the BLK in their name. I have tried placing the second line of the formula first but that does not change the retult either. I want all data to show, but if the BLK is part of the name then I want to direct the total to calculate on a different part number and table.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top