Results 1 to 7 of 7
  1. #1
    DOC is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2013
    Posts
    5

    Smile Report/Query Count help

    I am using access 2007.


    This is an example of a weekly attendance report/query I do.
    The QNI & QTC are Yes/No fields.
    I can get the NAME, QNI, & QTC totals.
    I cannot get the Sessions to equal 3, I get 9 for an answer.
    If I can do away with the "Sessions" that is good,
    if CheckinDate column can total 3 that would be better.
    Can I get the results in a query? or does it only come from a report? Both?
    Can anyone help me?


    CheckinDate NAME QNI QTC Sessions: (Day([CheckinDate]))
    11/2/2013 JOHN -1 0 2
    11/2/2013 FRED -1 1- 2
    11/2/2013 DOUG 0 0 2
    11/9/2013 JOHN 0 0 9
    11/9/2013 FRED -1 0 9
    11/9/2013 DOUG 1- 1- 9
    11/16/2013 JOHN -1 0 16
    11/16/2013 FRED -1 0 16
    11/16/2013 DOUG 0 0 16
    TOTAL: 9 6 2 3
    Last edited by DOC; 12-15-2013 at 11:20 AM.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    What is the SQL of your query?

    Can you tell us in plain English what you want your query to do?

    I cannot get the Sessions to equal 3.
    But your total for Sessions is 3????

  3. #3
    DOC is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2013
    Posts
    5
    The above is an illustration I built to show what I want a a final result.
    I can get totals for [NAME]=9. [QNI]=6, [QTC]=2. But I cannot get [Sessions] to equal 3. I get 9.

    The SQL below is as shown on my screen.

    SQL:
    SELECT tblNetArchive.NetID, tblNetArchive.Call, tblNetArchive.CheckinDate, tblNetArchive.QNI, tblNetArchive.QTC, (Day([CheckinDate])) AS Sessions
    FROM tblNetArchive
    GROUP BY tblNetArchive.NetID, tblNetArchive.Call, tblNetArchive.CheckinDate, tblNetArchive.QNI, tblNetArchive.QTC, tblNetArchive.ID, Year([CheckinDate]), Month([CheckinDate])
    HAVING (((tblNetArchive.NetID) Like "NMPN") AND ((Year([CheckinDate]))=[What Year?]) AND ((Month([CheckinDate]))=[What Month?]))
    ORDER BY tblNetArchive.ID;

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    I think you are trying to get a count of sessions grouped by CheckinDate. That is in the other fields you have the detail items but for sessions it appears you want a cOUNTof seSSION Grouped by CheckinDate... There are 9 session detail records, but there are 3 sessions if you group bu CheckinDate, and there are 3 sessions if you group by Name..

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    How are you generating those totals? Are they calcs in report footer section? Set up a group section in the report and do calcs in group footer.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    DOC is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2013
    Posts
    5
    I tried running a report, making a group with the "Sessions" field. It looked like it should work as the "2", "9", and "16" separated in the report, but I don't know the formula.
    I still couldn't get it to count the days to get (3), counted the number of records.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Have to group on the date or on the name fields to get the group count of 3 for each.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 7
    Last Post: 12-05-2012, 10:10 AM
  2. Parameter Query/Report Question to Count Text
    By Lettyg82 in forum Reports
    Replies: 6
    Last Post: 08-13-2012, 03:47 PM
  3. Count records based on report ,not in query
    By Abasalic4 in forum Reports
    Replies: 1
    Last Post: 04-13-2012, 12:46 PM
  4. Replies: 0
    Last Post: 07-13-2011, 08:32 AM
  5. Replies: 7
    Last Post: 07-22-2010, 01:14 PM

Tags for this Thread

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