Forum Moderators: open

Message Too Old, No Replies

Need Help with an SQL Select Statement

         

kevinj

7:09 pm on Jan 29, 2003 (gmt 0)

10+ Year Member



I have a database that has a table called exhibitors. I need to write a select statement that counts the number of records in that table and then use a Response.Write statement to display that number. Any ideas would be greatly appreciated.

wardbekker

7:26 pm on Jan 29, 2003 (gmt 0)

10+ Year Member



"Select Count(*) As TotalExhibitors From exhibitors"

Response.write oRecordset("TotalExhibitors")

(assuming you created an oRecordset that contains the result of the sql statement)

kevinj

8:39 pm on Jan 29, 2003 (gmt 0)

10+ Year Member



Thanks wardbekker. Works perfectly.

txbakers

9:06 pm on Jan 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can also use the oRecordset.RecordCount command if you set the cursor correctly. I don't recall the specific terms, but I set mine to all 3s and you can use the RecordCount. That way you don't need a separate query to get the count.