• A couple of things:

    1. You need a GROUP BY on your query.

    2. You can address NULL values for Ac_Billbook.CostsNet 2 ways. You wrap the SUM with an ISNULL, ISNULL(Sum(Ac_Billbook.CostsNet), 0) because SUM ignores nulls when summing or you can reverse the SUM and ISNULL like this, Sum(ISNULL(Ac_Billbook.CostsNet, 0)) which will convert individual NULL's to 0. Doesn't really matter which one you do. The first might perform slightly better because the ISNULL is only being applied once. I've never actually tested it.