If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Retrieving results of a COMPUTE statement

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-28-03, 10:22
WarrenRoscoe WarrenRoscoe is offline
Registered User
 
Join Date: Feb 2003
Posts: 4
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??
Reply With Quote
  #2 (permalink)  
Old 02-28-03, 22:31
rahulqa rahulqa is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On