stevenblanc
Registered User.
- Local time
- Today, 05:56
- Joined
- Jun 27, 2011
- Messages
- 103
Hey folks,
So I'm building a query for export to excel based on user filters and so forth.
It was working dandily, until I threw in some code to replace field names with values from another table. Now rather than look for problems with the vba, i'd like to figure out what the hell is wrong with the SQL.
So here's the SQL:
It's all one solid mass, but I figure no one would brave it that way
Basically the only thing I've done to it since the working version is include the "As *" for the numPedi, notePedi, and timePedi
The error I get is the following:
Error Number: 3061
Error Description: Too few parameters. Expected 30.
So I'm building a query for export to excel based on user filters and so forth.
It was working dandily, until I threw in some code to replace field names with values from another table. Now rather than look for problems with the vba, i'd like to figure out what the hell is wrong with the SQL.
So here's the SQL:
Code:
SELECT
tblCourseRecords.RecordID AS RecordID,
tblDepartments.DepartmentID AS DepartmentID,
tblSemesters.semTitle AS Semester,
tblSemesters.SemYear AS Sem_Year,
tblCourseRecords.courseID AS Course,
tblCourseRecords.sectionID as Sections,
tblCourseRecords.facultyID as Instructor,
tblCourseRecords.dateEntry as Date_Entered,
tblCourseRecords.dateModify as Date_Modified,
tblCourseRecords.numEnrollment,
tblCourseRecords.numPed1 AS Number_Lap_Reports,
tblCourseRecords.numPed2 AS Number_Exams_Multiple_Choice,
tblCourseRecords.numPed3 AS Number_Exams_One_Hour,
tblCourseRecords.numPed4 AS Number_Exams_Two_Hour,
tblCourseRecords.numPed5 AS Number_Placeholder1,
tblCourseRecords.numPed6 AS Number_Placeholder2,
tblCourseRecords.numPed7 AS Number_Placerholder3,
tblCourseRecords.numPed8 AS Number_Placeholder4,
tblCourseRecords.numPed9 AS Number_Placerholder5,
tblCourseRecords.numPed10 AS Number_Placerholder6,
tblCourseRecords.numPed11 AS Number_Placerholder7,
tblCourseRecords.numPed12 AS Number_Placerholder8,
tblCourseRecords.numPed13 AS Number_Placerholder9,
tblCourseRecords.numPed14 AS Number_Placerholder10,
tblCourseRecords.numPed15 AS Number_One_1_or_1_5_hour_lab,
tblCourseRecords.numPed16 AS Number_Two_1_or_1_5_hour_labs,
tblCourseRecords.numPed17 AS Number_One_2_hour_lab,
tblCourseRecords.numPed18 AS Number_One_3_hour_labs,
tblCourseRecords.numPed19 AS Number_Two_2_hour_labs,
tblCourseRecords.notePed1 AS Note_Lap_Reports,
tblCourseRecords.notePed2 AS Note_Exams_Multiple_Choice,
tblCourseRecords.notePed3 AS Note_Exams_One_Hour,
tblCourseRecords.notePed4 AS Note_Exams_Two_Hour,
tblCourseRecords.notePed5 AS Note_Placeholder1,
tblCourseRecords.notePed6 AS Note_Placeholder2,
tblCourseRecords.notePed7 AS Note_Placerholder3,
tblCourseRecords.notePed8 AS Note_Placeholder4,
tblCourseRecords.notePed9 AS Note_Placerholder5,
tblCourseRecords.notePed10 AS Note_Placerholder6,
tblCourseRecords.notePed11 AS Note_Placerholder7,
tblCourseRecords.notePed12 AS Note_Placerholder8,
tblCourseRecords.notePed13 AS Note_Placerholder9,
tblCourseRecords.notePed14 AS Note_Placerholder10,
tblCourseRecords.notePed15 AS Note_One_1_or_1_5_hour_lab,
tblCourseRecords.notePed16 AS Note_Two_1_or_1_5_hour_labs,
tblCourseRecords.notePed17 AS Note_One_2_hour_lab,
tblCourseRecords.notePed18 AS Note_One_3_hour_labs,
tblCourseRecords.notePed19 AS Note_Two_2_hour_labs,
tblCourseRecords.timePed1 AS Time_Lap_Reports,
tblCourseRecords.timePed2 AS Time_Exams_Multiple_Choice,
tblCourseRecords.timePed3 AS Time_Exams_One_Hour,
tblCourseRecords.timePed4 AS Time_Exams_Two_Hour,
tblCourseRecords.timePed5 AS Time_Placeholder1,
tblCourseRecords.timePed6 AS Time_Placeholder2,
tblCourseRecords.timePed7 AS Time_Placerholder3,
tblCourseRecords.timePed8 AS Time_Placeholder4,
tblCourseRecords.timePed9 AS Time_Placerholder5,
tblCourseRecords.timePed10 AS Time_Placerholder6,
tblCourseRecords.timePed11 AS Time_Placerholder7,
tblCourseRecords.timePed12 AS Time_Placerholder8,
tblCourseRecords.timePed13 AS Time_Placerholder9,
tblCourseRecords.timePed14 AS Time_Placerholder10,
tblCourseRecords.timePed15 AS Time_One_1_or_1_5_hour_lab,
tblCourseRecords.timePed16 AS Time_Two_1_or_1_5_hour_labs,
tblCourseRecords.timePed17 AS Time_One_2_hour_lab,
tblCourseRecords.timePed18 AS Time_One_3_hour_labs,
tblCourseRecords.timePed19 AS Time_Two_2_hour_labs,
tblCourseRecords.timeTotal as Total_Hours
FROM
tblCourseRecords,
tblSemesters,
tblCourses,
tblDepartments
WHERE
tblSemesters.semesterID = tblCourseRecords.semesterID
AND
tblCourses.courseID = tblCourseRecords.courseID
AND
tblDepartments.departmentID = tblCourses.courseDepartment
ORDER BY
tblCourseRecords.recordID
;
It's all one solid mass, but I figure no one would brave it that way
Basically the only thing I've done to it since the working version is include the "As *" for the numPedi, notePedi, and timePedi
The error I get is the following:
Error Number: 3061
Error Description: Too few parameters. Expected 30.