Too few parameters. Expected 1.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • nub

    #1

    Too few parameters. Expected 1.

    Using this exact query:
    -------------------------------
    SELECT ProductName, count(ProductNa me) 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(ProductNa me) 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...!?
  • Peter Doering

    #2
    Re: Too few parameters. Expected 1.

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

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

    HTH - Peter

    --
    No mails please.

    Comment

    • hal boyles

      #3
      Re: Too few parameters. Expected 1.

      reword the Order by

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




      Comment

      Working...