473,396 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Too few parameters. Expected 1.

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
2 10918
> 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
reword the Order by

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


Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Andrew Thompson | last post by:
I have written a few scripts to parse the URL arguments and either list them or allow access to the value of any parameter by name. <http://www.physci.org/test/003url/index.html>...
7
by: Dee | last post by:
Running an AfterUpdate event procedure, I get the following error: "Too few parameters. Expected 1." My code is as follows: Private Sub DealerID_AfterUpdate() Dim db As DAO.Database
8
by: RC | last post by:
In my Access 2002 form, I have a combo box and on the AfterUpdate event I use DoCmd.RunSQL ("UPDATE .... to update records in a table. When it starts to run I get a message "You are about to...
1
by: bonnie.tangyn | last post by:
Hello all I get Too few parameters expected 2 error and "The MS Jet Database engine cannot find the input table or query "myTempTablename". Make sure it exists and that its name is spelled...
2
by: Patrick Olurotimi Ige | last post by:
I converted the code below from VB.NET to C# cos i have to add it to a C# application!! But i'm getting the error:- System.Data.SqlClient.SqlCommand.Parameters' denotes a 'property' where a...
14
by: cody | last post by:
I got a similar idea a couple of months ago, but now this one will require no change to the clr, is relatively easy to implement and would be a great addition to C# 3.0 :) so here we go.. To...
1
by: Richard Hollenbeck | last post by:
I wonder what I'm missing? I really feel like a retard because I've been screwing with some code for a very long time. I just must be missing something very simple. In the following example,...
4
by: HeislerKurt | last post by:
I'm getting the infamous error, "Too few parameters. Expected 2", when executing an update SQL statement in VBA. I assume it's a SQL syntax issue, but I can't find the problem, and I used a VBA...
1
by: TheGuyKnownAsY | last post by:
Hi everyone, I'm new here. My problem: the parameters that appear after rs.open when oppening the SQL connection. Microsoft OLE DB Provider for ODBC Drivers error '80040e10' Too few...
5
by: mnarewec | last post by:
Hi folks, I want to create a procedure where by it will take a sqlcommand, a string, and property. I want to use this procedure to add parameters to my sql command of type stored procedures since I...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.