>>In VFP9 you can combine two of them into one using derived tables.
>
>Yes but as I said no need to combine.
>
>>
>>In VFP6:
>>
>>select max(Master_ind) as Master_Ind, Master_Code, count(*) as RecCount from myTable T1
>>where Master_Ind = 'Y' or not exists(select 1 from myTable T where T.Master_Code = T1.Master_Code and Master_Ind = 'Y')
>>group by Master_Code
>
>How would this do what he wants? Even if it did (I don't think it would but thinking if it were right) then can you really have an updateable view out of this???
>
>Cetin
I also don't think he can make an updatable view of this (this request left me puzzled last night). I just wanted to show a way to add the extra count column to the original query in VFP6.
If it's not broken, fix it until it is.
My Blog