Wing Posted February 15, 2007 Share Posted February 15, 2007 Hi, I've got a calculation field that is running the following calculation: If ( field one = "x" ; field two) This achieves the desired results. But, I also want to check field one for "y" and return a different result. I assumed I could add another "If" statement or an "else if" or "else" but can't seem to get this to work. Is there another way to get this done? Thanks!! -Wing Link to comment Share on other sites More sharing options...
Tmonk Posted February 15, 2007 Share Posted February 15, 2007 How about using the Case function in place of the If Link to comment Share on other sites More sharing options...
mr_vodka Posted February 15, 2007 Share Posted February 15, 2007 Use Case ( ) Instead Case ( field one = "x" ; field two; field one = "y" ; field three ) Link to comment Share on other sites More sharing options...
mr_vodka Posted February 15, 2007 Share Posted February 15, 2007 Also, keep in mind that the Case () Statement evaluates each test expression in the order it is in and exits the case statement after it hits the first test expression that evaluates as true. So order of evaluation is important. Link to comment Share on other sites More sharing options...
Wing Posted February 15, 2007 Author Share Posted February 15, 2007 That worked perfect! I wasn't familiar with Case function. Thanks! -W Link to comment Share on other sites More sharing options...
Lee Smith Posted February 15, 2007 Share Posted February 15, 2007 I perfer the Case over the If Statement because for me it is easier to read and write: BTW, the Online Help, under the If Statement, has this Note: If you have more than two possible results, consider using the Case function. Lee Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 6251 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now