I am using an IIF statement to do a calculation based on the order number, in our system any order below 90000000 is an order and any order above 90000000 is a credit this code works perfect for other scenarios however I am now trying to create a report that will list net QTY_SHP for all customers of a specific type and in some cases a customer may not have purchased anything so no order numbers in this scenario this code breaks cause they must have an order either greater than or less 90000000. What I would like this to do in this case is to give me a zero does anyone have any ideas?
Code:
Sum(IIf(PROOLN_M.ORD_NUM<'90000000',PROOLN_M.QTY_SHP,PROOLN_M.QTY_SHP*-1))