Simple question about Formula language

Posted on 2005-05-05
Last Modified: 2013-12-18
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?

Question by:attila01
    LVL 24

    Expert Comment

    > 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")


    Author Comment

    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.
    LVL 46

    Accepted Solution

    Change to
        @If(total=""; ""; total < 1000 ; "Username1"; "Username2")
        x:= @If( total < 1000 ; "Username1";"Username2");
        @If(@IsError(x); ""; x)

    Author Comment

    The @IsError can solve lots of problems, I think.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Suggested Solutions

    I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
    IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now