ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Parameter query with total (https://www.excelbanter.com/excel-programming/338317-parameter-query-total.html)

Megan M

Parameter query with total
 
I have a query in Microsoft query in which I want to count the results. In
addition, I want to have a parameter. I can set up the parameter or I can set
up the count, but it won't let me do both. Once the count is in place, if I
try to add a parameter, I get an error that says "Invalid column name
'Parameter1'. Statement(s) could not be prepared. If I remove the count and
add the parameter and then try to put the count back in, I get the same
error.

It's a simple query:
SELECT Worker.WorkerName, zCSContactMethod.LookupCode,
zCSContactMethod.LookupDesc, Count(CustomerService.ContactMethod) AS 'Count
of ContactMethod'
FROM IL_PSILink.dbo.CustomerService CustomerService, IL_PSILink.dbo.Worker
Worker, IL_PSILink.dbo.zCSContactMethod zCSContactMethod
WHERE CustomerService.WorkerID = Worker.WorkerID AND
CustomerService.ContactMethod = zCSContactMethod.LookupCode
GROUP BY Worker.WorkerName, zCSContactMethod.LookupCode,
zCSContactMethod.LookupDesc
HAVING (zCSContactMethod.LookupDesc='Call')

Any help would be much appreciated.
--
Megan M


All times are GMT +1. The time now is 10:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com