Wing Posted February 15, 2007 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
Tmonk Posted February 15, 2007 Posted February 15, 2007 How about using the Case function in place of the If
mr_vodka Posted February 15, 2007 Posted February 15, 2007 Use Case ( ) Instead Case ( field one = "x" ; field two; field one = "y" ; field three )
mr_vodka Posted February 15, 2007 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.
Wing Posted February 15, 2007 Author Posted February 15, 2007 That worked perfect! I wasn't familiar with Case function. Thanks! -W
Lee Smith Posted February 15, 2007 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
Recommended Posts
This topic is 6552 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