Alpha Video Training
Results 1 to 12 of 12

Thread: Count records

  1. #1
    Member
    Real Name
    Dwain Fick
    Join Date
    Aug 2003
    Location
    ND
    Posts
    61

    Default Count records

    I am creating a script in Xbasic whereby I need to count the records in each individual Account Number so I can form a loop for processing. I have tried dbcount, and it works if as follows:
    dbcount("Invpyts","An","N67"), where N67 is one Acct #.
    But I can't get the following to work:
    Where AN = Acct #:
    dbcount("Invpyts","An","An"). Where An changes often. It always returns 0.
    I've searched for an alternative, but can find none.
    Am I missing something?

  2. #2
    BRIAN GRAY
    Guest

    Default RE: Count records

    Hello Dwain,

    Is AN a variable? If so try Var-"AN Where you have "AN"

    Do not use quotes

    Brian

  3. #3
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default RE: Count records

    I think Brian is on the right track, try

    dbcount("Invpyts","An",accountnumberfieldname)

    where accountnumberfieldname is not in quotes.

  4. #4
    Member
    Real Name
    Dwain Fick
    Join Date
    Aug 2003
    Location
    ND
    Posts
    61

    Default RE: Count records

    No. An is a regular field that holds all account #'s.
    So, guess I need another solution?

    Dwain

  5. #5
    Member
    Real Name
    Dwain Fick
    Join Date
    Aug 2003
    Location
    ND
    Posts
    61

    Default RE: Count records

    I've tried that and it gives an error 'An not found'.

  6. #6
    BRIAN GRAY
    Guest

    Default RE: Count records

    Hello Dwain,

    Can you post your stript.
    Brian

  7. #7
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default RE: Count records

    "I've tried that and it gives an error 'An not found'. "

    This means that in the context in which you are trying to use the expression, "An" has no meaning.

    Try the following in the interactive window

    an = "N67"

    ? "dbcount("Invpyts","An",var-"an)

    this should return some valid answer.

    Context is everything. Without knowing the specifics of where you are trying to use your script, accurate help is impossible.


    To quote from the advice on this page, "In programming-related questions, provide as much detail as you can, this will secure a more complete resolution, more quickly."

  8. #8
    Member
    Real Name
    Dwain Fick
    Join Date
    Aug 2003
    Location
    ND
    Posts
    61

    Default RE: Count records

    Thanks for your reply....
    I would gladly post my script if I knew how, but I would welcome instructions on how to do it.

    Dwain

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

    Default RE: Count records

    Dwain

    The best approach is to zip your database and attach it to a message.

    See attached image for the visual.

  10. #10
    Member
    Real Name
    Dwain Fick
    Join Date
    Aug 2003
    Location
    ND
    Posts
    61

    Default RE: Count records

    After opening the Database, click Quit on my menu. Goto the Code tab. Click on Chgs=Payts - design. I have put a comment in it showing what the script is intended to do.
    As it is now, there are no payments that will equal the charges.
    May I suggest you create new tables for invchgs2 and invpts so it doesn't upset my balances. If you can get it to perform that will be just great. Thanks for your efforts.

    Dwain

  11. #11
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default RE: Count records

    should be

    dbcount("invpyts","An",tbl_2.an)

  12. #12
    Member
    Real Name
    Dwain Fick
    Join Date
    Aug 2003
    Location
    ND
    Posts
    61

    Default RE: Count records

    That takes care of the problem. Thank you so much...Dwain

Similar Threads

  1. Count records in report
    By dcorcoran in forum Alpha Five Version 5
    Replies: 3
    Last Post: 02-28-2004, 10:46 PM
  2. Query Records Count
    By David Agan in forum Alpha Five Version 5
    Replies: 2
    Last Post: 10-04-2002, 01:08 PM
  3. count records
    By crimmelcp in forum Alpha Five Version 4
    Replies: 7
    Last Post: 04-18-2001, 03:11 AM
  4. Count records in a query
    By Jamin Dunivan in forum Alpha Five Version 4
    Replies: 5
    Last Post: 04-17-2001, 12:33 PM
  5. Count of records.
    By Rodney Efird in forum Alpha Five Version 4
    Replies: 1
    Last Post: 05-17-2000, 07:34 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
  •