-
Capturing a Compute Sum
I have a stored proc:
Procedure test_sum
As
SELECT PayTotal, PayAmount
FROM escrowPay
Where Client='DEMO CLIENT'
ORDER BY PayTotal
COMPUTE SUM(PayAmount) BY PayTotal
return
which returns the following in SQL Query Analyzer:
PayTotal PayAmount
Null 732.2500
Null 192.4500
sum
924.7000
I would like to return only the sum value to a textbox on an asp page
Can anybody help me please...
-
Re: Capturing a Compute Sum
Spidermake,
Make a modified copy of the stored proc so it only returns your sum. From
the ASP page instantiate and open your DB connection and instantiate a
recordset object. Then use the stored proc name as your argument in the open
method of the recordset object.
In your html use this code...
<input type="text" name="mySumDisplay" value="<%= myRS(0)%>">
Michael
"Spidermake" <spidermake@hotmail.com> wrote in message
news:3e68d10b$1@tnews.web.devx.com...
>
> I have a stored proc:
>
> Procedure test_sum
> As
> SELECT PayTotal, PayAmount
> FROM escrowPay
> Where Client='DEMO CLIENT'
> ORDER BY PayTotal
> COMPUTE SUM(PayAmount) BY PayTotal
> return
>
> which returns the following in SQL Query Analyzer:
>
> PayTotal PayAmount
> Null 732.2500
> Null 192.4500
>
> sum
> 924.7000
>
> I would like to return only the sum value to a textbox on an asp page
>
> Can anybody help me please...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks