• You also don't have any sales for acct's 5/6 in June.

    How does this work for you?

    SELECT c.ACCT_NO, c.L_NAME, sum(IsNull(p.SALE_PRICE,0))

    FROM Creditor c

    LEFT JOIN Purchases p

    ON p.ACCT_NO = c.ACCT_NO

    AND p.DATE >= @fromDate

    AND p.DATE <= @toDate

    GROUP BY c.ACCT_NO, c.L_NAME

    HAVING sum(IsNull(p.SALE_PRICE,0)) <= @minPurchase

    ORDER BY c.L_NAME

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2