>Having a senior moment.........
>
>I have a table with the following data
>OWNER DEPT
>1 A
>1 A
>1 A
>2 A
>2 B
>3 B
>3 B
>3 B
>3 C
>
>and I need to get a count of how many departments there are for each owner
>OWNER NUM_DEPTS
>1 1 (A)
>2 2 (A/B)
>3 2 (B/C)
>
>In VFP 9 I would do something like
>SELECT aa.owner,COUNT(*) AS num_depts FROM (select DISTINCT owner,dept FROM myCursor) aa GROUP BY 1
>
>but I'm having trouble remembering how to do this in one statement in VFP 8
>
>All replies welcome.
>
>Thanks............Rich
select Owner, count(distinct Dept ) ;
from myCursor ;
group by 1
Gregory