>thanks Naomi your reply,can you expainme what is AddSQL.CatCount. not shoure about addsql. thanks
In VFP9 we can use derived tables, e.g. something like
select * from (select something else from ...) myDerivedTable
or
select * from Table1 inner join (select ...) myAdditionalSQL on ...
So I tried to apply this idea in your situation.
If it's not broken, fix it until it is.
My Blog