grpeachtree
Technical User
- Sep 5, 2012
- 7
I am using Peachtree Premium 2012, Crystal Reports 2008, pervasive sql is the database engine.
I am trying to create a formula to divide one field by another and eliminate the risk of dividing by 0.
My formula is:
(If {@Total Testers} <> 0 or if {@Total Sales} <> 0) then ({@Total Testers}/{@Total Sales} * 100) else 0
I have also tried:
(If {@Total Testers } <> 0 and if {@Total Sales} <> 0) then ({@Total Testers}/{@Total Sales} * 100) else 0
The result is the same: an error message displays the keyword "Then" is missing
After I click OK the cursor sits on the right parenthesis of "or if {@Total Sales} <> 0)"
Can someone help me with the correct syntax for the formula?
I am trying to create a formula to divide one field by another and eliminate the risk of dividing by 0.
My formula is:
(If {@Total Testers} <> 0 or if {@Total Sales} <> 0) then ({@Total Testers}/{@Total Sales} * 100) else 0
I have also tried:
(If {@Total Testers } <> 0 and if {@Total Sales} <> 0) then ({@Total Testers}/{@Total Sales} * 100) else 0
The result is the same: an error message displays the keyword "Then" is missing
After I click OK the cursor sits on the right parenthesis of "or if {@Total Sales} <> 0)"
Can someone help me with the correct syntax for the formula?