I think this is something specific to this combination of database file and query. I did an internet search for "odbc error number 07002" and found many different applications with the same issue. In each case, the resolution was to correct something about the query.
So, here are some things I would try:
- Double check spelling/capitalization of all column/table names
- Wrap all identifiers (column names, table names, aliases) in square brackets
- Make sure you only use aliases, if you have declared them. For example, I'd try changing your GROUP BY statement to GROUP BY Item
- Try the query in Access, to see if it is valid there, as @Jason Lightfoot suggests.
You could also try using a nested query instead of a HAVING clause, if ODBC supports nested queries:
SELECT Item, Max_SPQ FROM (
SELECT [FLEX PART NO] AS Item, MAX([SPQ]) AS Max_SPQ FROM SPQ
GROUP BY Item
) WHERE Max_SPQ > 1
.
Jordan Johnson
Principal Software Engineer
>