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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Condition issue in CRXI

Status
Not open for further replies.

karnd

Programmer
Feb 1, 2003
190
US
Hi,

created a formula field NUMBER datatype:

if not isnull({deptname})
then {AMOUNT}
else ""

but getting an error - Number is required here on ""

my req is i would like show empty or blank if deptname is null for AMOUNT field.

any ideas appreciated.

Thanks a lot,
 
Yeah, you're mixing data types in the output of the formula, the 1st condition is numeric, the second a string, you can't do that.

Try:

if not isnull({deptname}) then
{AMOUNT}
else
0

Then right click the formula and select format field->X 2 next to suppress, and palce:

{@MyFormula} = 0

Or you can convert it all to text:

if not isnull({deptname}) then
totext({AMOUNT},2,"")
else
""

The first solution allows for still using the field as a numeric so it's probably the way to go.

-k
 
try this:

if not isnull({deptname}) then
totext({AMOUNT}, 2, ",")
else
""
 
Hi,

Got you, Thanks a lot.
Regards,

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top