Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Too Few Parameters

Status
Not open for further replies.

Loomah

Technical User
Mar 4, 2002
1,911
IE
OK, I'm hoping this forum is more appropriate to this than the Office forum.

I'm trying to set up a spreadsheet to import data from a query in an Access database. The query simply extracts different data elements from 5 tables that will form the basis of a paybill model.

Using xl and Access 97 I've gone through the normal routine for importing data into excel and get to the end of the query only to get the error message
"Too Few Parameters. Expected 2."

Clicking help just tells me to check the driver documentation for a fuller explanation - I simply don;t have the documentation.

I'm no expert in using Access and would appreciate any pointers as to what I might be missing out. If I create a table from my Access query I can import the table without any problems. I can also import data using other queries that work on one table.

Any help appreciated.
thanks

;-)
If a man says something and there are no women there to hear him, is he still wrong? [ponder]
How do I get the best answers?
 
Seems that your query is a parametized one ...
Any chance you could post the SQL code ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
The "Too Few Parameters" message usually means either

- PHV's observation that the query is a parameterized query and you haven't supplied values for the parameters.

OR

- You are referencing field names in the query that don't exist in the underlying tables.
 
OK, here's the SQL for the access query that I'm trying to use as the source to import data into xl. This query works fine on its own!

Code:
SELECT PAY_SiP.PAY_EmpNum, PAY_SiP.PAY_Title, PAY_SiP.PAY_Initials, CHRIS_SiP.HR_FirstName, PAY_SiP.PAY_Surname, PAY_SiP.PAY_Control_Group, PAY_SiP.PAY_Paygroup, CHRIS_SiP.[HR_Region/Agency], CHRIS_SiP.[HR_Group/Area], CHRIS_SiP.HR_Division, CHRIS_SiP.HR_Organisation, PAY_SiP.PAY_Grade_Code, PAY_SiP.PAY_Grade_Desc, CHRIS_SiP.HR_DTG, PAY_SiP.PAY_FTE, CHRIS_SiP.HR_FTE, GradeCodes.Years_To_Max, GradeCodes.Min_Current, GradeCodes.Max_Current, PAY_SiP.PAY_MT_Rate, PAY_SiP.PAY_Salary_Desc, RR_PGO.[RR_Salary_at_01/08/03], RR_DCA.[RR_Salary_at_01/08/03], PAY_SiP.PAY_Basic_Salary, CHRIS_SiP.HR_GradeCode, CHRIS_SiP.HR_DistinctGrade
FROM GradeCodes RIGHT JOIN (((PAY_SiP LEFT JOIN CHRIS_SiP ON PAY_SiP.PAY_EmpNum = CHRIS_SiP.HR_EmpNum) LEFT JOIN RR_DCA ON PAY_SiP.PAY_EmpNum = RR_DCA.Emp_Num) LEFT JOIN RR_PGO ON PAY_SiP.PAY_EmpNum = RR_PGO.Emp_Num) ON GradeCodes.GradeCode = PAY_SiP.PAY_Grade_Code;

The PK on most of the tables is the employee number (usually EmpNum. The PK in the GradeCodes table is GradeCode. the PAY_SiP table basically sits in the middle of all the relationships, star schema like!

As I probably didn't spell out in my original post, the whole purpose of this query is to amalgamate data from various tables into a single source. The query is then made the "target" of a data query in excel - which won't complete!!

I can work around this problem by creating a table from the query and using that as my data source for excel but that adds another step into the whole process blah blah!!

;-)
If a man says something and there are no women there to hear him, is he still wrong? [ponder]
How do I get the best answers?
 
So, GradeCodes, PAY_SiP, CHRIS_SiP, RR_DCA and RR_PGO are all tables (no query at all) ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Yep, all linked by EmpNum (or some derivative of it) except GradeCodes which is related to PAY_SiP by the GradeCode field.

;-)
If a man says something and there are no women there to hear him, is he still wrong? [ponder]
How do I get the best answers?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top