sql - Excel table to Access query connection, [Microsoft][ODBC Microsoft Access Drive] too few parameters. expected 1 -
i'm trying create table in excel, takes data access query. i'm unable find query listed under data->from access. i'm using data->from other sources -> data connection wizard -> odbc dsn. on final step throws error [microsoft][odbc microsoft access drive] few parameters. expected 1.
i not post full query @ moment, long
i post subquery part (with formatting) , throws error. can take , pinpoint problem.
all queries have work in access. need results export excel, whole reporting vba tool there. (i know can make select , create table, not elegant , simple update) thank time. have nice day
select employees.persno, employees.employee_name, employees.reporting_month, employees.gender_key, employees.start_date, employees.business_unit, employees.position_id, employees.position, employees.local_band, employees.ps_group, employees.wage_amount, val(employees.bonus) [bonus_%], val([employees].[commissions_(%)]) [commisions_%], employees.wage_type, employees.wkhrs, q1.business_unit, q1.position_id, q1.position, q1.local_band, q1.ps_group, q1.wage_amount, [q1].[bonus_%], [q1].[commisions_%], employees.wage_type, employees.wkhrs, employees.evid_status employees left join (select dateadd("m",1,[employees.reporting_month]) reporting_month, employees.persno, employees.local_band, employees.ps_group, employees.wage_amount, val(employees.bonus) [bonus_%], val([employees].[commissions_(%)]) [commisions_%], employees.wage_type, employees.wkhrs, employees.business_unit, employees.position_id, employees.position, employees.evid_status employees employees.evid_status=1 ) q1 on (employees.reporting_month = [q1].[reporting_month]) , (employees.persno = [q1].[persno]) employees.evid_status=1;
because position reserved word in ms accces, escape word in both outer query , subquery backticks or square brackets.
interestingly, while table alias qualifier works reserved words inside msaccess.exe gui program, external odbc calls excel may fail without escaping such reserved words:
select ... employees.[position], ... select ... employees.`position`, ...
Comments
Post a Comment