By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,488 Members | 2,545 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,488 IT Pros & Developers. It's quick & easy.

Too few parameters. Expected 1.

P: n/a
nub
Using this exact query:
-------------------------------
SELECT ProductName, count(ProductName) as Quantity, sum(TotalPrice) as
Total
FROM OrderDetails
GROUP BY ProductName
ORDER BY Total DESC

I'm getting:
-------------------------------
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected
1.
Here's the ASP (just in case)
-------------------------------
SQL = "SELECT ProductName, count(ProductName) as Quantity,
sum(TotalPrice) as Total " & _
"FROM OrderDetails " & _
"GROUP BY ProductName " & _
"ORDER BY Total DESC"

I tried importing the Access db to SQL and ran this query w/Query
Analyzer and it worked fine. So something must be different for
access...!?
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
> Using this exact query:
-------------------------------
SELECT ProductName, count(ProductName) as Quantity, sum(TotalPrice) as
Total
FROM OrderDetails
GROUP BY ProductName
ORDER BY Total DESC I'm getting:
-------------------------------
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected
1.


Try "ORDER BY Sum(TotalPrice) DESC" instead.

HTH - Peter

--
No mails please.
Nov 12 '05 #2

P: n/a
reword the Order by

ORDER BY Sum([Order Details].UnitPrice) DESC;


Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.