Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - SQL Functions in ASP (Max, Min, Count
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SQL Functions in ASP (Max, Min, Count

 Post Reply Post Reply
Author
coolnlstuff View Drop Down
Newbie
Newbie
Avatar

Joined: 26 April 2003
Location: Netherlands
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote coolnlstuff Quote  Post ReplyReply Direct Link To This Post Topic: SQL Functions in ASP (Max, Min, Count
    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.



Edited by coolnlstuff
Back to Top
ultramods View Drop Down
Groupie
Groupie
Avatar

Joined: 08 January 2003
Location: Scotland
Status: Offline
Points: 146
Post Options Post Options   Thanks (0) Thanks(0)   Quote ultramods Quote  Post ReplyReply Direct Link To This Post Posted: 26 April 2003 at 1:31pm

Dim maxbalance

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

maxbalance = rs_Results("maxbalance")

Back to Top
coolnlstuff View Drop Down
Newbie
Newbie
Avatar

Joined: 26 April 2003
Location: Netherlands
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote coolnlstuff Quote  Post ReplyReply Direct Link To This Post Posted: 26 April 2003 at 4:04pm

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

Thanks again!

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.