• If you provide full sample data (all columns included and multiple rows that cover all situations) we can help you locate the problem.

    Like Lynn Pettis allready pointed out: the additional columns in the SELECT and GROUP BY are most likely the cause of your issue. If just a bit of data between the rows is different, these don't add up and won't reflect to the filter in the HAVING clause.

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **