Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2003
    Posts
    4

    Unanswered: Retrieving results of a COMPUTE statement

    Has anyone tried retrieving the results of a SQL statement that has a COMPUTE clause at the end??

    I am trying to get the sum and average values from a resultset and don't want to code this all manually in VB/ASP. Using NextRecordset does not work for the following SQL Statement.

    SELECT CustomerID, EmployeeID, Freight FROM Orders WHERE CustomerID LIKE 'VINET%' COMPUTE SUM(Freight), AVG(Freight), SUM(EmployeeID)

    I get run time error 3251 - Current provider does not support returning multiple resultsets from a single execution.

    This is from the Northwind DB provided with SQL Server.

    Any ideas??

  2. #2
    Join Date
    Feb 2003
    Posts
    18
    Check your connection settings and also the type of recordset used.

    This query should work
    "SELECT CustomerID, EmployeeID, Freight FROM Orders WHERE CustomerID LIKE 'VINET%' COMPUTE SUM(Freight), AVG(Freight), SUM(EmployeeID)","DSN=;UID=;PWD=;",3,3

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •