Results 1 to 13 of 13
  1. #1
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370

    Creating a report



    Need Completed
    # left to complete Document Creation # completed
    # left to complete Forms Creation # completed
    # left to complete Reviews Completed # completed
    # left to complete Packages Completed # completed
    # left to complete Mailing # completed
    # left to complete Invoices # completed
    # left to complete Signatures # completed













    Basically, Each cell in the middle column is a field in my table(without the spaces). And all of these fields are Date fields. I need to count the number of records for each field that are null(this would be the # left to complete), and I need to count the number of records that are not null(this would be the # completed).

    How would I go about setting this up?

    Any help would be greatly appreciated!

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I would create a separate query using the query builder. I would use the wizard. I would opt for the "Find Unmatched Records" or something close to that description. Basically, I would want a query that had an Outer Join on the Date field and then an Is Null for the criteria of said field.

    With that, I would add an aggregate function like Count(). Then figure a way to bring this query into a parent query.

  3. #3
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    what do you meant outer join on the date field?

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I mean an outer join vs an Inner Join

    So the SQL would be LEFT or RIGHT

    If you use the wizard to create an Unmatched Record query, it will generate the SQL. Then you can look at it in Design View and add your aggregate function

  5. #5
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    How do i create the unmatched record query on the same table? It's not showing up for the second step of the wizard

  6. #6
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    This is my SQL returned for an Unmatched query on my table and simple query of the table: SELECT PPARestatementTable.DocumentsCreated, PPARestatementTable.FormsCreated, PPARestatementTable.DateReviewed, PPARestatementTable.FinalPackageCreated, PPARestatementTable.RestatementMailed, PPARestatementTable.InvoicePlan, PPARestatementTable.[DocumentSigned&Returned], PPARestatementTable.DateSignedDocsScannedFROM PPARestatementTable LEFT JOIN [PPARestatementTable Query] ON PPARestatementTable.[PPARestatementID] = [PPARestatementTable Query].[PPARestatementID]
    WHERE ((([PPARestatementTable Query].PPARestatementID) Is Null));

  7. #7
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    So you are looking for records that do not have a value in PPARestatementID? Is that your Date field?

  8. #8
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    No, I need to count the number of records for each field([DocumentCreation],[FormsCreation]...etc) that are null(this would be the # left to complete), and I need to count the number of records that are not null(this would be the # completed).

  9. #9
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I would start with a query for the records that are Null. You will need to make a JOIN for each field you want to determine as Null, FormsCreation to FormsCreation etc. Then Continue with the Is Null criteria for each field you created a JOIN for, using the AND or OR where applicable.

  10. #10
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    Ok so, I'm struggling to understand. But I kind of figured out a way. I'm going to make queries that will give me the count of records. How do I call the count of a query in my report? would it be =Count([QueryName]) or what? I'm getting an enter parameter error when I use that

  11. #11
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    You can create an alias and count a single field. In a Totals query you can add the following to a new field in the grid at the bottom of the window.
    MyCount: [tblName].[DocumentCreation]

    If you still do not have the Unmatched Records thing down, I suggest using the wizard again and read the prompts. Afterwards, add additional JOINS, as I suggested in post #9, for the remaining fields. Your additional JOINS should mimic the singular JOIN and Criteria created by the Wizard.

  12. #12
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    Ok, I created a query, and it returns 350 records.

    What will be the SQL for a text box that displays the number of records (350) from that query?

    EDIT: Never mind, I figured it out. I'm just creating queries with the required criteria, and getting the count of the queries and adding those counts to my report. I now have about 15 queries, but it was really easy to do. I probably didn't do the most elegant way.

  13. #13
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I doubt you will require 15 query objects to accomplish your task. If you feel like revisiting this at a later date, I may have more time, at that point, to provide you with some examples.

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

Similar Threads

  1. Creating a report from a form
    By sabre1 in forum Forms
    Replies: 2
    Last Post: 11-12-2010, 03:32 PM
  2. creating report
    By Balen in forum Reports
    Replies: 1
    Last Post: 08-12-2010, 06:45 PM
  3. Creating a report
    By nebuk89 in forum Reports
    Replies: 3
    Last Post: 07-01-2010, 06:49 AM
  4. Creating a report with calculations
    By Normantom in forum Queries
    Replies: 1
    Last Post: 05-07-2010, 06:29 AM
  5. Help with creating a Report..
    By TylerZ07 in forum Reports
    Replies: 2
    Last Post: 12-11-2009, 07:51 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