ms access - using IIF in msaccess report -


i have formula in report

=(sum([final]*[units]))/sum([units]))

final - integer has ng mixed in records units - integer re-exam - contains integer

now, current formula, if [final] encounters value ng, report gives error, want determine if value of [final] ng, [re-exam] checked if contains value else 0 added sum[final] , if [re-exam] contains value, [re-exam]*[units] added sum[final]

the final result displays result in general number format

i thinking of using iif can't generate correct formula @ moment , that's need fix

try using val returns 0 non-numeric string.:

=sum(iif(val([final])=0,val([re-exam]),val([final]))*[units])/sum([units]) 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -