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"));
 

Forum statistics

Threads
1,077,926
Messages
5,337,242
Members
399,134
Latest member
ChetManley

Some videos you may like

This Week's Hot Topics

Top