ibiubu Posted April 18, 2002 Posted April 18, 2002 I know this format below is incorrect, but it gives the idea of what I am after: If(field1>0 & field2>0, "Yes") or If(field1>0 & field2<1, "No") or If(field1<0, "Empty", "") It looks like it would work correctly, but doesn't. Does it make sense what I am trying to do? LR
andygaunt Posted April 18, 2002 Posted April 18, 2002 What you need is a case statement. Case(field1>0 & field2>0, "Yes", field1>0 & field2<1, "No", field1<0, "Empty", "") It allows multiple choices within a calculation. And it is easier to read. HTH
Fitch Posted April 18, 2002 Posted April 18, 2002 Watch those ampersands. It should read: code: Case ( field1 > 0 and field2 > 0, "Yes", field1 > 0 and field2 < 1, "No", field1 < 0, "Empty" ) Note that the trailing "" (blank) is not required in a Case[] statement. The "&" symbol is used to concatenate text strings. The "or" you had in your original calc also has a specific logical function.
andygaunt Posted April 18, 2002 Posted April 18, 2002 Fitch. My Bad . Wasn't focusing properly back then. Thanks for correcting for me.
RussBaker Posted April 19, 2002 Posted April 19, 2002 You can nest a series of IF statements - but CASE is better. Using nested IFs, it would look like: code: If(field1>0 and field2>0, "Yes", If(field1>0 and field2<1, "No", If(field1<0, "Empty", ""))) Russ
Recommended Posts
This topic is 8325 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