Try
TEXT TO lcSql TEXTMERGE NOSHOW PRTEXT 15
SELECT Country.Numero, Country.<<gcReturnTitle>> AS Title, COUNT(DISTINCT School.Numero)
FROM FROM School
JOIN Country ON School.NoCountry=Country.Numero
WHERE School.Status=2
ORDER BY 2
ENDTEXT
I'm not sure what field you shoud use in
COUNT(DISTINCT School.Numero) because I don't know youtr tables structure/relationship.
Also notice how easier to maintain queries using TEXTMERGE.
>Well, I did go back to not having AutoInc. This simple lack of support from Microsoft made me realize the preparation to be as close as possible to SQL Server, as far as the VFP data structure goes, was a no go. I really need to use the ODBC approach to be as generic as possible. But, now I need to find a way to have a solution for a syntax that will allow me to have a ODBC query that will be done from a cursor. As this is not possible, the last think I want to do is to query into a table first and use the full path of that table, for my INNER JOIN, thru ODBC. Is there any other alternative to achieve that? Basically, I need to group first into a query and then INNER JOIN that.
--sb--