Thanks for the response. I did try adding AS which is
optional and it didn't make a difference (the query ran fine before
as is and there are two queries in the same file that use similar
syntax and they run OK).
Your other points are valid but my query does comply with
both of them (it would produce a different error if it didn't).
Incidentally the QuerySetCell() doesn't have anything to do
with it because I still get the error even if I don't use it.
This is a previous query in the same file that runs OK
without an error:
<cfquery name="qOERanges" dbtype="query">
select SortKey, predir_abbr, str_suffix_abbr, postdir_abbr,
prmy_low_nbr, min(prmy_high_nbr) prmy_high_nbr,
prmy_odd_even_code, crid_id, str_name, int100, intLow, 1 as
intOE, urb, zip_code
from qOERanges
where prmy_odd_even_code <> 'O'
group by SortKey, predir_abbr, str_suffix_abbr,
postdir_abbr,
prmy_low_nbr, prmy_odd_even_code, crid_id, str_name, int100,
intLow, urb, zip_code
UNION
select SortKey, predir_abbr, str_suffix_abbr, postdir_abbr,
prmy_low_nbr, min(prmy_high_nbr) prmy_high_nbr,
prmy_odd_even_code, crid_id, str_name, int100, intLow, 2 as
intOE, urb, zip_code
from qOERanges
where prmy_odd_even_code <> 'E'
group by SortKey, predir_abbr, str_suffix_abbr,
postdir_abbr,
prmy_low_nbr, prmy_odd_even_code, crid_id, str_name, int100,
intLow, urb, zip_code
order by SortKey, intOE, intLow, prmy_odd_even_code
</cfquery>
Ken