Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 731
  • Last Modified:

Simple question about Formula language

A Computed Field has the following formula:

@If( total < "1000" ; "Username1";@If( total > "1000" ;"Username2";""))

but I get following error:

ERROR: Comparison operators must be supplied two values of the same data type.

What should I change in the Formula?

0
attila01
Asked:
attila01
  • 2
1 Solution
 
HemanthaKumarCommented:
> ERROR: Comparison operators must be supplied two values of the same data type.
obviously you are comparing string "1000" and not the value

corrected formula

@If( total < 1000 ; "Username1";@If( total > 1000 ;"Username2";""))

or simply
@If( total < 1000 ; "Username1";"Username2")





~Hemanth
0
 
attila01Author Commented:
When I use  
total < "1000"
I can open the db and can open the form and get the error when saving the form.

When I use  
total < 1000
I can open the db but when I try to open the form I get immediately the error message:
Field: 'apperson': Comparison operators must be supplied two values of the same data type.

And the form won't even be opened.
0
 
Sjef BosmanGroupware ConsultantCommented:
Change to
    @If(total=""; ""; total < 1000 ; "Username1"; "Username2")
or
    x:= @If( total < 1000 ; "Username1";"Username2");
    @If(@IsError(x); ""; x)
0
 
attila01Author Commented:
The @IsError can solve lots of problems, I think.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now