>Ok, but does that mean that I include all the fields I mentioned? What about the IIF that uses two fields? Or do I use numbers for every column I'm going to create that is not a SUM?
>
select iif(field1=3,field2,field1) as expr1, field2, sum(field3) as sum from myTable group by 1,2
For all non aggregate column you should put them into Group by. You can not use Memo field in your select.
If it's not broken, fix it until it is.
My Blog