Results 1 to 4 of 4
  1. #1
    cgjames is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    8

    Count Restricted by Date

    Hello all,

    I am a therapist, not a programmer, but my agency cannot afford a programmer to fix our database disaster, so I have been commissioned. This thing is truly nuclear. There are around 80 tables with a good 50-60 fields per table on average. Roughly 200 queries and 50 reports. Many of these won't open or are broken or lead nowhere. There are no modules defined, but most forms have some VB in them. The entire database does not have a single relationship defined. It's freakin me out just looking at it. The guy that built it has been charging our agency hundreds of dollars an hour and taking 8-10 hours at a time to report on what was in the database. I came into the agency and informed them that Access can automate reports, and that they were being scammed. It sucks, because we provide free therapy to sexual abuse victims that have no money, and he was stealing from us. I'm hoping to leave all of the tables in tact and just design reports on top of the nuclear waste pile that is this database. Everything seems to function and interrelate through queries, so it may be possible! If anyone knows any volunteer database programmers, let me know!



    In the meantime, here's my question. I want to count the number of times a boolean item was checked "yes" between two dates. These dates will be entered by the user whenever the report is opened. Each record in this table has date, client id, and around 30 boolean items that I need to report on. What is the most efficient way to do that?

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Off the top of my head:

    SELECT Abs(Sum(Field1)) AS Field1Count
    FROM TableName
    WHERE DateField Between Forms!FormName.txtFromDate AND Forms!FormName.txtToDate

    That would have you using a form for the user to enter the dates. You can add other fields.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    cgjames is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    8
    Awesome, got it. Thanks!

  4. #4
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    Still need a db guy? I only charge a fraction of "hundreds of dollars an hour"

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

Similar Threads

  1. user restricted query
    By adidashawn6 in forum Queries
    Replies: 1
    Last Post: 01-06-2011, 11:24 AM
  2. Count Down and close on date code
    By ibraomer in forum Programming
    Replies: 1
    Last Post: 01-03-2011, 08:58 PM
  3. How to count data from another query by date
    By Brian62 in forum Queries
    Replies: 2
    Last Post: 11-17-2010, 11:35 AM
  4. Replies: 1
    Last Post: 07-07-2010, 04:22 PM
  5. Count Dates within Date Range
    By eckert1961 in forum Queries
    Replies: 2
    Last Post: 03-08-2009, 10:58 AM

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