Bill,
Here's a WHERE that works
WHERE Detail.avr_wtg = .T.
The Having clause is not necessary and it is even NOT recommended since the issue can be resolved against the source table.
>This will cause a data-type mismatch. If he's testing against the result of the iif(), he's got to use the HAVING clause.