Will it work for you if you split it into two SELECTs - one to do the aggregation and second for GROUP BY ?
>Working just fine in VFP7. Adding any of the aggregates gives me "Cannot GROUP by aggregate field." Adding the payroll logical was my first guess - no dice. Same error. Guess here that the IIF() constitutes an aggregrate field?
>
>>>CLeaning up DBC prior to moving an app into VFP8, and the following view is giving me grief as far as the grouping. Can someone let me know what the problem is?
>>
>>Is it giving problems in VFP8 or before the move?
>>
>>if after, it needs the payroll column in the group by [all non-aggregate columns in select are now required in the group by]
>>
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison