Access Data Produces "Too Few Parameters" Error in

dmcgimpsey

Active Member
Joined
Mar 30, 2004
Messages
268
Hi Everyone

I am trying to record a query using the query editor - it goes against a union query in access.


I get an error saying "Error, too few results returned, expected 2"

this error is causing me lots of problems, I was hoping there was a work-around.

I checked the microsoft database, and they say to use a make-data query, but I cannot do this, since the parameters in the query are dynamic, and have to be substituted in the query.

I also tried to uncheck the "use query wizard' option - this didn't work as well.

Here is my query:

SELECT master_1.model_id, 1 as count
FROM ((((master INNER JOIN master AS master_1 ON master.model_id = master_1.strip_score)
LEFT JOIN master AS master_2 ON master_1.model_id = master_2.strip_score)
LEFT JOIN master AS master_3 ON master_2.model_id = master_3.strip_score)
LEFT JOIN master AS master_4 ON master_3.model_id = master_4.strip_score)
LEFT JOIN master AS master_5 ON master_4.model_id = master_5.strip_score
GROUP BY master.model_id, master_1.model_id, master_2.model_id, master_3.model_id, master_4.model_id, master_5.model_id, master.Frequency
HAVING (((master_1.model_id)<>"") AND ((master.Frequency)="weekly"));

union

SELECT master_2.model_id, 1 as count
FROM ((((master INNER JOIN master AS master_1 ON master.model_id = master_1.strip_score)
LEFT JOIN master AS master_2 ON master_1.model_id = master_2.strip_score)
LEFT JOIN master AS master_3 ON master_2.model_id = master_3.strip_score)
LEFT JOIN master AS master_4 ON master_3.model_id = master_4.strip_score)
LEFT JOIN master AS master_5 ON master_4.model_id = master_5.strip_score
GROUP BY master.model_id, master_1.model_id, master_2.model_id, master_3.model_id, master_4.model_id, master_5.model_id, master.Frequency
HAVING (((master_1.model_id)<>"") AND ((master.Frequency)="weekly"));

union

SELECT master_3.model_id, 1 as count
FROM ((((master INNER JOIN master AS master_1 ON master.model_id = master_1.strip_score)
LEFT JOIN master AS master_2 ON master_1.model_id = master_2.strip_score)
LEFT JOIN master AS master_3 ON master_2.model_id = master_3.strip_score)
LEFT JOIN master AS master_4 ON master_3.model_id = master_4.strip_score)
LEFT JOIN master AS master_5 ON master_4.model_id = master_5.strip_score
GROUP BY master.model_id, master_1.model_id, master_2.model_id, master_3.model_id, master_4.model_id, master_5.model_id, master.Frequency
HAVING (((master_1.model_id)<>"") AND ((master.Frequency)="weekly"));union

SELECT master_4.model_id, 1 as count
FROM ((((master INNER JOIN master AS master_1 ON master.model_id = master_1.strip_score)
LEFT JOIN master AS master_2 ON master_1.model_id = master_2.strip_score)
LEFT JOIN master AS master_3 ON master_2.model_id = master_3.strip_score)
LEFT JOIN master AS master_4 ON master_3.model_id = master_4.strip_score)
LEFT JOIN master AS master_5 ON master_4.model_id = master_5.strip_score
GROUP BY master.model_id, master_1.model_id, master_2.model_id, master_3.model_id, master_4.model_id, master_5.model_id, master.Frequency
HAVING (((master_1.model_id)<>"") AND ((master.Frequency)="weekly"));

UNION SELECT master_5.model_id, 1 as count
FROM ((((master INNER JOIN master AS master_1 ON master.model_id = master_1.strip_score)
LEFT JOIN master AS master_2 ON master_1.model_id = master_2.strip_score)
LEFT JOIN master AS master_3 ON master_2.model_id = master_3.strip_score)
LEFT JOIN master AS master_4 ON master_3.model_id = master_4.strip_score)
LEFT JOIN master AS master_5 ON master_4.model_id = master_5.strip_score
GROUP BY master.model_id, master_1.model_id, master_2.model_id, master_3.model_id, master_4.model_id, master_5.model_id, master.Frequency
HAVING (((master_1.model_id)<>"") AND ((master.Frequency)="weekly"));
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,214,957
Messages
6,122,466
Members
449,086
Latest member
kwindels

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top