Click here to Skip to main content
15,890,527 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello,

I wrote this code in formula fields.
C#
shared numbervar bb;
if isnull({tbl1.sumbed}) and isnull({tbl1.sumbes})
then 0
else bb := bb + ({tbl1.sumbed}-{tbl1.sumbes});

I build tbl1 in DataSet. The fields in it same as fields in my query.

But I have this error: A Number,or currency fields,date,time is required.

Please someone help me.
Posted
Updated 28-Nov-11 22:56pm
v2

1 solution

Your null check will return 0 only if both the fields are null - what if one of them is null? Try changing the "and" check to "or".
HTH
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900