MS Query 'Too Few Parameters - Expected 2'

okiearcher

New Member
Joined
Sep 19, 2014
Messages
1
Hi all.

Newbie poster here.

I have an Access07 Union query that works great and pulls the data just like I need, in Access. When I try to use the query in Excel07 MS Query to pull the data into a sheet in the workbook, I get the error in the title line. Can someone please shed light on why I might be getting this error in MS Query link?

Thanks for your time.
okiearcher

Here's the SQL (in Access):

SELECT [WMNovarprojects].[StoreNbr] & Format([WMNovarprojects].[Sequence],"000") & [WMNovarProjects].[State] AS Project, Sum(WMNovarProjectPOs.QuoteAmount) AS TotPO, WMNovarProjects.SAP_USE_NBR, WMNovarProjects.ProjectPossessionDate AS PossDate
FROM WMNovarProjects INNER JOIN (Quotes INNER JOIN WMNovarProjectPOs ON Quotes.QuotesID = WMNovarProjectPOs.QuotesID) ON (WMNovarProjects.WMProjID = WMNovarProjectPOs.WMProjID) AND (WMNovarProjects.WMProjID = Quotes.WMProjID)
GROUP BY [WMNovarprojects].[StoreNbr] & Format([WMNovarprojects].[Sequence],"000") & [WMNovarProjects].[State], WMNovarProjects.SAP_USE_NBR, WMNovarProjects.ProjectPossessionDate, WMNovarProjectPOs.POCancelled, Quotes.Revised
HAVING ((([WMNovarprojects].[StoreNbr] & Format([WMNovarprojects].[Sequence],"000") & [WMNovarProjects].[State]) Not Like "999*") AND ((WMNovarProjects.ProjectPossessionDate) Between DateSerial(Year(Date())-1,1,1) And DateSerial(Year(Date())+2,1,1)-1) AND ((WMNovarProjectPOs.POCancelled)=False) AND ((Quotes.Revised)=False))
ORDER BY [WMNovarprojects].[StoreNbr] & Format([WMNovarprojects].[Sequence],"000") & [WMNovarProjects].[State], WMNovarProjects.ProjectPossessionDate;


UNION SELECT [WMNovarprojects].[StoreNbr] & Format([WMNovarprojects].[Sequence],"000") & [WMNovarProjects].[State] AS Project, Sum(WMNovarProjectPOs.QuoteAmount) AS TotPO, WMNovarProjects.SAP_USE_NBR, WMNovarProjects.ProjectPossessionDate
FROM WMNovarProjects INNER JOIN WMNovarProjectPOs ON WMNovarProjects.WMProjID=WMNovarProjectPOs.WMProjID
GROUP BY [WMNovarprojects].[StoreNbr] & Format([WMNovarprojects].[Sequence],"000") & [WMNovarProjects].[State], WMNovarProjects.SAP_USE_NBR, WMNovarProjects.ProjectType, WMNovarProjects.ProjCreatedBy, WMNovarProjects.ProjectPossessionDate
HAVING (((WMNovarprojects.StoreNbr & Format(WMNovarprojects.Sequence,"000") & WMNovarProjects.State) Not Like "999*") And ((WMNovarProjects.ProjectPossessionDate) Between DateSerial(Year(Date())-1,1,1) And DateSerial(Year(Date())+2,1,1)-1));
 
Last edited:

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Forum statistics

Threads
1,214,591
Messages
6,120,432
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top