S
Steve S
I have a table (tblRecapB) with 40 fields. A Query qryRecap of this table
uses a variation of the following subquery to rank [MPP] into [MRank], [SPP]
into [SRank] and [TPP] into [TRank]. xPP stands for place points (something
like a score).
MRank: 1+(SELECT Count(*)
FROM tblRecapB AS M
WHERE M.[Fee Id]=tblRecapB.[Fee ID] and M.[AGSortKey]=tblRecapB.[AGSortKey]
And M.MPP < tblRecapB.MPP)
This works great as long as I just run the query standalone.
The problem is that when I use qryRecap as the record source for the final
report I get the following error: “Multi-level GROUP BY clause not allowed
in a subqueryâ€. If I remove the three fields MRank, SRank, and TRank, the
report (all other 40 fields) is OK. If I remove all Group Headers the three
fields generated by the subquery are displayed as expected.
I tried to get around this by creating an intervening query, qryRecapX, that
just selects all 43 fields of qryRecap. I then used this new query as record
source for the report and did not get any errors. All fields and group
headers are displayed. The problem now is that [Mranl], [Srank], and [TRank]
all have a value of 1 but when I run the new query standalone the values for
these 3 fields display correctly.
Next I changed the design of the table tblrecapB by adding the three new
fields to it and trying to use variations of the subquery above in an Update
Query to calculate the ranks. This way the values I need would be
‘hardcoded’ in the table and not calculated at report time. Can’t seem to
get this to work. Should I be using Dcount() instead of Count()???
Any suggestions and/or help is appreciated
uses a variation of the following subquery to rank [MPP] into [MRank], [SPP]
into [SRank] and [TPP] into [TRank]. xPP stands for place points (something
like a score).
MRank: 1+(SELECT Count(*)
FROM tblRecapB AS M
WHERE M.[Fee Id]=tblRecapB.[Fee ID] and M.[AGSortKey]=tblRecapB.[AGSortKey]
And M.MPP < tblRecapB.MPP)
This works great as long as I just run the query standalone.
The problem is that when I use qryRecap as the record source for the final
report I get the following error: “Multi-level GROUP BY clause not allowed
in a subqueryâ€. If I remove the three fields MRank, SRank, and TRank, the
report (all other 40 fields) is OK. If I remove all Group Headers the three
fields generated by the subquery are displayed as expected.
I tried to get around this by creating an intervening query, qryRecapX, that
just selects all 43 fields of qryRecap. I then used this new query as record
source for the report and did not get any errors. All fields and group
headers are displayed. The problem now is that [Mranl], [Srank], and [TRank]
all have a value of 1 but when I run the new query standalone the values for
these 3 fields display correctly.
Next I changed the design of the table tblrecapB by adding the three new
fields to it and trying to use variations of the subquery above in an Update
Query to calculate the ranks. This way the values I need would be
‘hardcoded’ in the table and not calculated at report time. Can’t seem to
get this to work. Should I be using Dcount() instead of Count()???
Any suggestions and/or help is appreciated