Results 1 to 6 of 6
  1. #1
    catat is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    17

    Counting Active Records Between 2 Dates

    Hello Everyone,



    I am trying to create a report that will calculate the number of children served within a period of two dates (a quarter). The issue I am having is that within the Children table, there is no date field, so I am not sure how to determine which children were "Active" during this period.

    I have tried taking information from three different tables. All three tables are connected through the FuID (Family Unit ID).
    The first is the Family Unit table which consists of FuID , FamName , Active (Yes/No).
    The second is the Case Status table which consists of CsID, FuID, Status (Waitlist, Active, Closed, etc.), and StatusEffective (date).
    The third is the Children table which consists of ChID , FuID, LastName, FirstName, DOB, and Active (Yes/No).
    The first two tables are not really necessary for the report, but I tried using the StatusEffectiveDate from the Case Status to get the Between dates, but this only pulls children that have had their Case Status updated within that time frame.

    Ultimately, I would like the query to pull .... What children were checked off as Active between Date 1 and Date 2, regardless if they became inactive between these dates. Is this possible without a date stamp in the table?

    For my first database, everything had seemed to be set up correctly (thanks to you guys) until this problem!

    Thanks in advance!

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    Tables dont have a "hidden" datestamp on record creation or modification so unless there are dates to work with, there really isnt anything you can do... at least not that I know of. Unless Microsoft came out with a GoBackInTime() function, I think you're stuck.

  3. #3
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    Oh man, a GoBackInTime() function would be AWESOME!

    You should write one Shabz!

  4. #4
    catat is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    17
    Ha! Yes, that would be awesome...

    So... is there anything I can do now to pull this information in the future?! Meaning is there something I should add to the Children table?...

    Thanks for replying anyways..

  5. #5
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    I would just add a (Short) Date field to it with a Default Value of =Date().

    Just be sure to set this field to the day before your last quarter started on all of your pre-existing Records so they don't show up in any of your queries erroneously.

  6. #6
    catat is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    17
    I managed to figure it out by using a date from a fourth table.. It works perfectly so far.

    The parameter was set for,,
    [Start Date (dd/mm/yyyy)]
    [End Date (dd/mm/yyyy)]

    The criteria within the query was..

    Case Status StatusEffectiveDate ServiceStartDate
    Criteria: "Active" <=[End Date (dd/mm/yyyy)]
    Or: "Closed" <=[End Date (dd/mm/yyyy)] Or >=[Start Date (dd/mm/yyyy)]


    Thanks!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Counting Dates
    By JenBouchard in forum Access
    Replies: 1
    Last Post: 01-22-2010, 05:08 PM
  2. Replies: 4
    Last Post: 08-27-2009, 01:21 AM
  3. Counting returned records in a query
    By johncob in forum Queries
    Replies: 0
    Last Post: 02-11-2009, 05:30 PM
  4. Counting records based on specified criteria
    By GrnISSO in forum Queries
    Replies: 2
    Last Post: 10-04-2007, 03:07 PM
  5. Replies: 1
    Last Post: 11-11-2006, 08:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums