if statement - Crystal Report converting value to number with symbol -


i have issue crystal report i'm creating. using fields database , pulling in result value analysis field equal values. in condition first check looks @ analysis field , checks if equal "conf". result "<10" second check looks @ analysis field , checks if equal "original". result "20".

i want results display in order above following basic logic returns result of 20.

if analysis = "conf" result else if analysis = "original" result 

i having issue multiple records solved converting both results numbers (tonumber(result)). record has less symbol contained within field value causes conf result "be skipped" , display original result instead. i've tried few things without success. here code condition of i'm @ below. fell way complex logic i've added i've had ideas , shows i've tried.

if {units} = "cfu_g" if {analysis} = "conf" , {result}="" or {result} = "0" 0 else if {analysis} = "conf" if isnumeric({result}) tonumber({result}) else tonumber(replace ({result}, "<", ""))  else   if {units} = "cfu_g" if {analysis} = "original" , {result}="" or {result} = "0" 0 else if {analysis} = "original" if isnumeric({result}) tonumber({result}) else tonumber(replace ({result}, "<", "")) 

thanks, tom

this solution came with.

field 1 whileprintingrecords; stringvar vresult := "";  field 2 whileprintingrecords; stringvar vresult; vresult :=  if {result.units} = "cfu_g" , {result.analysis} = "cra_lis_enu_conf_mpcram29"  {result.formatted_entry}  else if {result.analysis} = "cra_list_enu_mpcram29" , {result.units} = "cfu_g" , vresult = "" {result.formatted_entry}  field 3 whileprintingrecords; stringvar vresult; vresult; 

Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -