Alpha Video Training
Results 1 to 4 of 4

Thread: Count of dates in report, counts all, with or without date.

  1. #1
    Member MikeData's Avatar
    Real Name
    Mike Data
    Join Date
    Nov 2008
    Posts
    923

    Default Count of dates in report, counts all, with or without date.

    Count of dates in report, counts all, with or without date.
    In other words using count in a report, if there are 7 records in the criteria, will show 7 records.
    If there are only 4 with date filled and 3 blanks one.
    Here is the code used:
    memb_count_for_famRec = count(famRec,grp->memb,grp->Detail)

    How can I get only the count of records with dates filled only?
    Any advise?

  2. #2
    "Certified" Alphaholic
    Real Name
    Gregg Schmidt
    Join Date
    Mar 2001
    Location
    Milwaukee
    Posts
    1,388

    Default Re: Count of dates in report, counts all, with or without date.

    Hi Mike,

    My first thought is use SQL, it makes this so much easier.
    My second thought is you probably have to use some kind of filter.
    I don't know where you are using this particular code, but if you try
    to generate a summary table, which will handle count, you will have the
    option to include a filter than resembles .not. isblank("<dateField>")

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

    Default Re: Count of dates in report, counts all, with or without date.

    Count() doesn't have a filter argument.

    define a calculated field with a filter to determine if you want it to count.

    If .t. then =1 , else =0

    total the calculated field for the count.
    __________________

    famRecHasADate = if(.not. isblank("famRec"),1,0)

    memb_count_for_famRec = total(calc->famRecHasADate,grp->memb,grp->Detail)
    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.

  4. #4
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,687

    Default Re: Count of dates in report, counts all, with or without date.

    Anther suggestion: If your scripts/ reports need to use the date for a filter, you might want to consider adding a calc field to the table that converts the data using dtoc(yourdate). It is also handy for when you want to sort by date in an embedded browse because alpha sorts dates on the year first.

    Oops, at least on the desktop...
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

Similar Threads

  1. Create a report by company with customer counts
    By NerdJim in forum Alpha Five Version 10 - Desktop Applications
    Replies: 5
    Last Post: 03-18-2015, 03:54 PM
  2. Count Days In-between Two Date Fields In Report
    By tommyrotten in forum Application Server Version 10 - Web/Browser Applications
    Replies: 17
    Last Post: 11-06-2010, 03:57 PM
  3. Demographic report counts
    By Jordans17x in forum Application Server Version 10 - Web/Browser Applications
    Replies: 4
    Last Post: 02-06-2010, 12:34 PM
  4. Count Instances Between Dates
    By Chuck Bytes in forum Alpha Five Version 10 - Desktop Applications
    Replies: 13
    Last Post: 01-23-2010, 09:28 PM
  5. Report Field Value counts
    By shawnmk in forum Alpha Four Version 6 and Prior
    Replies: 1
    Last Post: 12-11-2005, 09:55 PM

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
  •