Unanswered: Too few parameters error when Get External Access Data
I use Excel as a front-end for an Access database.
I have tried running a manual Get External Data > New Database Query, and it seems to connect to the Access database fine because it lists the fields and lets me select them and so on, but when I click "Finish" to import the data it comes back with an error "Too few parameters. Expected 7."
My SQL statement doesn't use any parameter passing and it works fine in Access. The SQL is as follow :
SELECT [rptFormat].[type], [rptFormat].[group], (IIF([res1].[GP_TTL] > 0, [res1].[GP_TTL], 0)) AS [ttl]
(SELECT [em_mast].[type_code], [em_mast].[l2_code], count(*) AS [Gp_TTL]
WHERE (([em_mast].[L2_CODE]<>"X") AND ([em_mast].[COMPANY_CO]="ABC") AND ([em_mast].[STAFF_STAT]="A"))
GROUP BY [em_mast].[type_code], [em_mast].[l2_code])
AS [res1] )
ON (([rptFormat].[type] = [res1].[type_code]) AND ([rptFormat].[group]=[res1].[l2_code] ))