Records Count...

Results 1 to 2 of 2

Thread: Records Count...

  1. #1
    Join Date
    Dec 1969

    Default Records Count...

    I want to count a certain record I have but only if there&#039;s a value in it. How can I do it?<BR><BR>Here&#039;s what I got so far:<BR>SQL = "select count(colors) FROM members_TABLE"<BR>rs.Open SQL,DSN,3,1<BR><BR>colors = rs("colors")<BR><BR>rs.close<BR><BR>Thanks!

  2. #2
    Join Date
    Dec 1969

    Default Explain more?

    If the colors field is NULL for a given record, then I don&#039;t think it *will* be counted.<BR><BR>Have you tried it?<BR><BR>And you can&#039;t do<BR> rs("colors")<BR>since <BR> SELECT count(colors)<BR>produces NO NAME in the recordset for that first field.<BR><BR>Either just do<BR> rs(0)<BR>or use an alias in the SQL:<BR> SELECT count(colors) AS COLOR_COUNT<BR>and then use<BR> rs("COLOR_COUNT")<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