I’ve been banging my head against the wall a while.
I have a table that has “DwgID” (integer) and “Current” (boolean) as part of the table.
What I want to do is filter just the DWGID’s that have more than 1 Current selected.
This code gives me the count correctly:
SELECT “DwgID”, SUM( CASE WHEN “Current” = 1 THEN 1 ELSE 0 END ) “Current” FROM “tblRev” GROUP BY “DwgID”
But if I try to add a criteria where the Current Count is > 1, it fails with a data content could not be loaded.
SELECT “DwgID”, SUM( CASE WHEN “Current” = 1 THEN 1 ELSE 0 END ) “Current” FROM “tblRev” GROUP BY “DwgID” HAVING ( ( SUM( CASE WHEN “Current” = 1 THEN 1 ELSE 0 END ) > 1 ) )
What am I doing wrong?