Counting records in a DB

Results 1 to 2 of 2

Thread: Counting records in a DB

  1. #1
    Scott H. Guest

    Default Counting records in a DB

    Hello,<BR><BR>I have an Access DB with a column named &#039Media&#039. There are three possible values: TV, Radio, or Newspaper. Is there a simple way to count the number of occurences of each value?<BR><BR>Thank you all for your help!!

  2. #2
    Join Date
    Dec 1969

    Default RE: Counting records in a DB

    &#060;%<BR>SQL = "SELECT Media, Count(*) AS MediaCount FROM table GROUP BY Media"<BR>Set RS = someConnection.Execute( SQL )<BR>Do Until RS.EOF<BR>&nbsp; &nbsp; Response.Write "There are " & RS("MediaCount") & " occurrences of " & RS("Media") & "&lt;BR&#062;"<BR>&nbsp; &nbsp; RS.MoveNext<BR>Loop<BR>%&#062;<BR><BR>NOTE: If any of them have a zero count, then they will *not* show up in the output, at all.<BR><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