harry8 Posted February 27, 2002 Posted February 27, 2002 In my 'days past due field' I have the calculation: today's date - billing date - 30 The calculation (sum) can be a positive or negative number (and it works well). However, I want the number appearing in the 'days past due' field to be greater than zero only. If it's zero or a negative number, I want the field to be blank. How do I do this? thanks.
Oldsneekers Posted February 28, 2002 Posted February 28, 2002 Try using an If or Case statement for the calc field: If (Today-BillingD-30)>0, Today-BillingD-30, "0") or Case( Today-BillingD-30)>0, Today-BillingD-30, Today-BillingD-30)less than or equal to 0, "0") Hope this helps, greg
Oldsneekers Posted February 28, 2002 Posted February 28, 2002 My error, I wasn't wearing my reading glasses. If you want the field to blank ranther than zero, as I first thought, for negative numbers the case or if statement for that eventuality should be: Case T-BD-30 greater than or equal to 0,T-BD-30 T-BD-30 < 0, "" or If T-BD-30 greater than or equal to 0,T-BD-30, "". The "" is a pair of parenthases without a space in between. sorry for the confusion, greg.
harry8 Posted February 28, 2002 Author Posted February 28, 2002 Thanks Greg -- the zero is OK -- here's what seems to work: If(today's date-billing date-30>0, (today's date-billing date-30), "0" or Case(today's date-billing date-30>0, (today's date-billing date-30) >=0, "0")) I don't understand the syntax (rationale) of the open/close parens -- but I'm not going to worry about it. thanks again, Harry
Oldsneekers Posted February 28, 2002 Posted February 28, 2002 The empty pair of parentheses ensures the field will be blank for negative numbers, as I originally wrote the test for zero and positive numbers. If the test is for positive numbers and the alternative is zero, the empty pair of parentheses is not necessary. Also unnecessary in case statements but, it's late, and my brain is shutting down. Have a good day, correction, night. greg.
Oldsneekers Posted February 28, 2002 Posted February 28, 2002 The empty pair of parentheses ensures the field will be blank for negative numbers, as I originally wrote the test for zero and positive numbers. If the test is for positive numbers and the alternative is zero, the empty pair of parentheses is not necessary. Also unnecessary in case statements but, it's late, and my brain is shutting down. Have a good day, correction, night. greg.
Recommended Posts
This topic is 8375 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