Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Division by zero error

Status
Not open for further replies.

sonny1974

Technical User
Feb 25, 2007
161
US
WhilePrintingRecords;
Not OnFirstRecord;
if not({Command.RANK}= 3 and previous ({Command.RANK})=2)
and ({Command.TRAN_CODE} = '28') or
not({Command.RANK}= 3 and previous({Command.RANK})=2 and
{Command.TRAN_CODE} <> previous({Command.TRAN_CODE}))then
numbervar mytot:=mytot+{Command.APPROVED}%Sum ({@po}, {Command.RCVR})

how can i fix my division by zero error
 
Try changing this section to

numbervar mytot:=mytot+{Command.APPROVED}%(if Sum ({@po}, {Command.RCVR} = 0 then 1 else Sum ({@po}, {Command.RCVR}))

I'm guessing this is the field causing your error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top