ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Too few parameters (https://www.excelbanter.com/excel-discussion-misc-queries/231667-too-few-parameters.html)

Laebrye

Too few parameters
 
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 DataImport External DataNew 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



Laebrye

Too few parameters
 
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?

"Laebrye" wrote:

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 DataImport External DataNew 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




All times are GMT +1. The time now is 02:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com