We help IT Professionals succeed at work.

# Designer Formula question

on
Medium Priority
222 Views
I need a formula for a form that says if field A is <=5 and field B is NULL return an error.  If field A is >= 5, field B can be blank.

I keep getting an error that comparison operators must be supplied two values of the same data type.
Comment
Watch Question

## View Solution Only

CERTIFIED EXPERT
Top Expert 2007

Commented:
1) Formula sometimes has isues with trying to detect nul fileds.

What kind of fields are these ( String, numerical ? )

t may be wise to convert them according to the type of compare needed.

If A  is a string convert it to a number first.

I hope this helps !
CERTIFIED EXPERT
Top Expert 2007

Commented:
@TextToNumber may be useful.

Please post your formula so that we can try to correct it.

I hope this helps !
IT Director

Commented:
A is a numerical rating, B is a text field for comments.  I need the formula to require comments if the rating is less than 5.
IT Director

Commented:
@if(Rating="";@failure("You must enter a Rating");@Success);
@If(Rating<=5 & Comments=""; @Failure("You Must Enter Comments if Rating is 5 or lower");@Success);
@If(Rating=>5 & Comment=""); @Success
CERTIFIED EXPERT
Top Expert 2007
Commented:
Correct the last 2  :

@If(@TextToNumber(Rating)<=5 & Comments=""; @Failure("You Must Enter Comments if Rating is 5 or lower");@Success);

@If(@TextToNumber(Rating)>5 & Comment=""); @Success

I hope this helps !

Not the solution you were looking for? Getting a personalized solution is easy.

Access more of Experts Exchange with a free account
##### Thanks for using Experts Exchange.

Limited access with a free account allows you to:

• View three pieces of content (articles, solutions, posts, and videos)
• Ask the experts questions (counted toward content limit)
• Customize your dashboard and profile