Alpha Video Training
Results 1 to 9 of 9

Thread: Count Status "Active" in a table to put on a page.

  1. #1
    Member
    Real Name
    Rodney Ramsue
    Join Date
    Jun 2008
    Posts
    13

    Default Count Status "Active" in a table to put on a page.

    This may seem like a very elementary question, but I've been having problems with it.* How do you query a table to count the number of records that meet a certain criteria and put that "Count" into a variable or field on a web page?* I've tried the query.filter with the tbl.query_create() and I've had no success. I've also tried an SQL filter but with no success. I was able to create the Count in a variable using SQL but that's it.
    Last edited by rcr211; 11-25-2010 at 05:38 AM.

  2. #2
    Member JimDK's Avatar
    Real Name
    Jim Andreasen
    Join Date
    Feb 2007
    Location
    Denmark
    Posts
    234

    Default Re: Count Status "Active" in a table to put on a page.

    Are you using dbf files or SQl tables

  3. #3
    Member
    Real Name
    Rodney Ramsue
    Join Date
    Jun 2008
    Posts
    13

    Default Re: Count Status "Active" in a table to put on a page.

    I am using dbf files.

  4. #4
    Member JimDK's Avatar
    Real Name
    Jim Andreasen
    Join Date
    Feb 2007
    Location
    Denmark
    Posts
    234

    Default Re: Count Status "Active" in a table to put on a page.

    The <TBL>.RECORDS_GET() will give the number of records in the table, and if you want to se the number of records in a selection you can use QUERY.RECORDS_GET()

  5. #5
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,644

    Default Re: Count Status "Active" in a table to put on a page.

    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  6. #6
    Member
    Real Name
    Rodney Ramsue
    Join Date
    Jun 2008
    Posts
    13

    Default Re: Count Status "Active" in a table to put on a page.

    This is what I continue to getDim tbl as PDim qry as Ptbl = table.open("testpeople")query.filter = "Status = 'Active'"qry = tbl.query_create()ERROR: Not an open table

  7. #7
    Member
    Real Name
    Rodney Ramsue
    Join Date
    Jun 2008
    Posts
    13

    Default Re: Count Status "Active" in a table to put on a page.

    Dim tbl as P
    Dim qry as P
    tbl = table.open("testpeople")
    query.filter = "Status = 'Active'"
    qry = tbl.query_create()
    ERROR: Not an open table

  8. #8
    Member
    Real Name
    Rodney Ramsue
    Join Date
    Jun 2008
    Posts
    13

    Default Re: Count Status "Active" in a table to put on a page.

    I found my problem for my filter. I didn't have it properly indexed. it works now...

    Thanks for the assistance Al.

  9. #9
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,644

    Default Re: Count Status "Active" in a table to put on a page.

    Quote Originally Posted by rcr211 View Post
    Dim tbl as P
    Dim qry as P
    tbl = table.open("testpeople")
    query.filter = "Status = 'Active'"
    qry = tbl.query_create()
    ERROR: Not an open table
    You need an alias on the web side of coding..

    tbl = table.open("[PathAlias.ADB_Path]\testpeople")
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

Similar Threads

  1. "Field Display Formatting" is Lost when "Pre-fetch data for Detailed View = Active"
    By PhillipS in forum Application Server Version 9 - Web/Browser Applications
    Replies: 0
    Last Post: 07-23-2009, 11:02 PM
  2. "Add" and "Save" buttons don't stay on "Self" page
    By Scholin in forum Application Server Version 8
    Replies: 2
    Last Post: 02-05-2008, 08:50 AM
  3. A5W "Contact us" page info populating a database table
    By KimberlyPatt in forum Web Application Server v7
    Replies: 5
    Last Post: 12-28-2005, 10:57 AM
  4. hidden "leftover" table in A5W page
    By Steve Wood in forum Web Application Server v6
    Replies: 3
    Last Post: 09-16-2004, 04:18 PM
  5. kill "Table: Table_name" on status line
    By richarddsmith in forum Alpha Five Version 5
    Replies: 7
    Last Post: 10-02-2002, 02:52 AM

Bookmarks

Posting Permissions

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