John M wrote:
I have just tried the same expression as the SELECT. Same result. I thne
tried sorting on a different field (YearGrp) in the same table but not used
in the select, and the same result. I've also cut and paste from a query in
which I call Surname and Forename AllName. In this too the conflict arises.
Despite your help, i'm lost!!
Then, by all means do a Totals query and group on the name expression.
(No, I can't stand this)
The Help says:
U hebt een SQL-instructie gemaakt met een predikaat ALL, DISTINCT of
DISTINCTROW en een component ORDER BY die een veld bevat dat niet
voorkomt in de instructie SELECT. Verwijder het gereserveerde woord
DISTINCT, of verwijder het opgegeven veld uit de component ORDER BY.
(that's Dutch! Let's try to translate)
You created a SQL instruction with a predicate ALL, DISTINCT or
DISTINCTROW and a component ORDER BY with a field that is not in the
SELECT instruction. Remove the word DISTINCT or remove the field from
the component ORDER BY.
With this information, I removed Surname from the ORDER BY. This is my
result that runs without error:
SELECT DISTINCT Incidents.StudentID, [Incidents].[Surname] & " " &
[Incidents].[Forename] AS Expr1
FROM Incidents
WHERE (((Incidents.Surname)>""))
ORDER BY [Incidents].[Surname] & " " & [Incidents].[Forename];
--
Bas Cost Budde
http://www.heuveltop.org/BasCB
but the domain is nl