How do I handle empty number fields/variables in C

2019-09-04 17:37发布

I have the following formula in my group footer, but am having problems with displaying 0 if sample_perc is empty; this value gets empty if #rt_sample_ordered is blank.

NumberVar sample_perc := {#rt_sample_ordered}%{@sum_of_sample};
if (sample_perc>0)then
   sample_perc
else
  0

How do i print 0 when sample_perc is blank?

1条回答
Anthone
2楼-- · 2019-09-04 18:12
If Isnull({#rt_sample_ordered}) Or Isnull({@sum_of_sample}) Then
  0
Else If ( {#rt_sample_ordered}%{@sum_of_sample} ) > 0 Then
  sample_perc
Else
  0
查看更多
登录 后发表回答