I want to generate a report to compare the estimated_total_fee (on the usr_int1 table) with the amount the customer has actually been billed (from ac_billbook.costsnet).
Customers and their orders are identified by matters.entityref for the customer, and matters.number for the order number. Some customers may have had more than one bill generated on the same order; I don't need to know the details of every bill, just the total the customer has been billed for the one order so I'm using the Sum function.
However, I also need to account for orders that have not yet been billed so I want to include IsNull to allow for null values in the Ac_Billbook.costsnet column. I'm not sure how to phrase the syntax to allow for both Sum and IsNull on the same column.
Sum(Ac_Billbook.CostsNet) AS SumOfCostsNet
Ac_Billbook INNER JOIN
(Usr_Int1 INNER JOIN Matters ON
(Usr_Int1.MatterNo = Matters.Number)
AND (Usr_Int1.EntityRef = Matters.EntityRef))
ON (Ac_Billbook.MatterRef = Usr_Int1.MatterNo)
AND (Ac_Billbook.EntityRef = Usr_Int1.EntityRef)
Any help help gratefully received!