>Yeah, I should have phrased my question better. I wanted to be able to do it only in SQL code but thought it might be as simple as one SELECT statement (i.e. no unions or second SELECT statements). For some reason I thought it would be a lot easier than the different solutions presented. Go figure!
Kevin,
Here is the best and simplest solution for your problem (hint :):
select min(div_name) as division, cKeyID ;
from Division group by 1 ;
order by 2 into cursor curMin nofilter
select iif(div_name==division,CompanyNam,space(30), Div_Name ;
from Company inner join Division on Company.cKeyID=Division.cKeyID ;
left join curMin on Division.cKeyID=curMin.cKeyID ;
and Division.Div_Name=curMin.Division
If it's not broken, fix it until it is.
My Blog