Using SELECT count

Results 1 to 3 of 3

Thread: Using SELECT count

  1. #1
    Bobby Guest

    Default Using SELECT count

    Let&#039;s say I wanted to display the number of records in my database table using a select count statement:<BR><BR>strSQL = "SELECT COUNT(*) as nCount FROM table"<BR><BR>How can I pass that nCount variable to my ASP page, or just in general, what would be the best method for accomplishing this task?<BR><BR>Thanks,<BR>Bobby<BR>

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default Use a recordset <eop>


  3. #3
    Join Date
    Dec 1969

    Default higher overhead...

    especially for *big* tables<BR><BR>SELECT count(somecolumn) as ct FROM tableName WHERE criteria = whatever<BR><BR>would return a single-value RS, you just use objRS("ct") ot objRS(0)<BR><BR>j<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts