Hi,
I have this bit of code which, if the BidTotal field is over $3m then the Approval field is set with a list of approvers.
Num1:=@Text(BidTotal);
List1:=Over3mApp;
@Text(@If(Num1>“3000000”;List1;“”))
This code seems to be working if you enter anything up to 9,000,000 but as soon as I go into 10,000,000 or above, it’s not working.
BidTotal field is a Number field.
Does anyone happen to know why?
Thanks,
Hayley.
Subject: Number and Text field problem
Hi,
The BidTotal field is a number field and the other field is a text field as it has a list of names (approvers). So I’ve had to put @Text(BidTotal) when finding out the BidTotal in the field.
Not sure how I can get around this?
Any advice?
Thanks,
Hayley.
Subject: Number and Text field problem
Hi, when I do that I get the following error:
Error: Comparison operators must be supplied two values of the same data type.
Subject: Number and Text field problem
As the other poster pointed out, you just need to compare the numeric value, not change it to text, it doesn’t matter that the other field is text. The following should work:
@if(BidTotal>3000000;Over3mApp;“”)
Dan
Subject: Number and Text field problem
@If(BidTotal = “”; “”; BidTotal > 3000000; Over3mApp; “”)
As others have pointed out, you need to compare the values as numbers if you want to find out which number is bigger – comparing as text will tell you which one comes first in alphabetical sort order. The problem with that is that Notes fields are typed by their content, and until there is a number in the BidTotal field, it contains an empty string. You need to account for that empty string in the formula.
Subject: Number and Text field problem
Hi Hayley,
The reason is that 10,000,000(in text format) is smaller than 9,000,000 and 3,000,000 also (in same format).
Why you could not make comparison in original numeric format?
Best regards,
Dima Pechersky
Subject: Number and Text field problem
Thanks Everyone, this is now working. Much appreciated your help.