Too few parameters

L

Laebrye

Hi

I know it seems like I'm covering familiar ground here but I'm at my wit's
end with this problem.

I'm trying to set up a data query that runs off an access database in Excel.
To do this, I use Data>Import External Data>New Database Query...

In the wizard that opens I select MS Access Database, then navigate to said
database and import all the fields from a table in that database.

At the end of the wizard I select View data or edit query in Microsoft Query.

All is well up to this point, but when I add in parameter criteria and try
to run the query I get the increasingly annoying "Too few Parameters.
Expected 4" Error.

Thing is, the parameters I've set in the query total up to 4. I have two for
the date field to select all rows between two dates. And I have a further 2
in two other fields. The table I'm trying to create is a summation table, and
the parameters will all get their values from cells in the excel worksheet.
I'm trying to set this up so that the two date fields can be selected and
then the other 2 fields can be changed to alter the query like a filter, just
one that presents a sum of the records that meet the criteria rather than an
excel filter which willl only return the records.

I have searched and experimented all I can with this issue and I'm all out.
Can anyone please help me?

Regards
Dave
 
L

Laebrye

A quick update on this issue:

I've narrowed it down - the problem only exists when I attempt to do both
the Sum of the data fields AND the parameters in cells. Could this be because
the query renames the fields (i.e. "Sum of ..." )? Does anyone know if
there's a way around this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top