Print Page | Close Window

SQL Functions in ASP (Max, Min, Count

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: General Discussion
Forum Description: General discussion and chat on any topic.
URL: https://forums.webwiz.net/forum_posts.asp?TID=2167
Printed Date: 28 March 2026 at 9:10pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: SQL Functions in ASP (Max, Min, Count
Posted By: coolnlstuff
Subject: SQL Functions in ASP (Max, Min, Count
Date Posted: 26 April 2003 at 12:41pm

I have a question about a SQL-query with a function in it.
For instance:
SELECT Max(Balance) FROM Accounts
Now I want to get the result of that query in a variable in ASP.

So, I have in my sourcecode:

DIM maxbalance

strSQL = "SELECT Max(Balance) FROM Accounts"
SET rs_Results = Conn.Execute(strSQL)

Where Conn is my database connection.

How do I get the result of the query in the variable maxbalance? Waht is the sourcecode which I should put in my ASP-page.




Replies:
Posted By: ultramods
Date Posted: 26 April 2003 at 1:31pm

Dim maxbalance

strSQL = "SELECT Max(Balance) AS maxbalance  FROM Accounts"

maxbalance = rs_Results("maxbalance")



Posted By: coolnlstuff
Date Posted: 26 April 2003 at 4:04pm

Tnx, for your help, it was difficult to find on the internet, until now!!!

Thanks again!




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net