Results 1 to 2 of 2
  1. #1
    dinodeserter is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    8

    Make SQL count percents


    I have a query that counts the percent of administrators who have seen patients during a given month selected by a combo box. It doesn't add up to 100% each month though and I can't figure out why. Here is the SQL and a screen shot of the subform.
    Code:
    SELECT Month([DateofRounding]) AS [Month], [tblNurse Rounding Leader].NRLLastName, [tblNurse Rounding Leader].NRLFirstName, Count(*) AS [Number of Times Rounded], Count(*)/(SELECT Count(*) FROM tblPatient AS [XX] WHERE Month(tblPatient.[DateofRounding]) = [Forms]![frmMain_expandlg]![Subform1]![cboMonthRPT])*1 AS [Percent Total]
    FROM [tblNurse Rounding Leader] INNER JOIN tblPatient ON [tblNurse Rounding Leader].[Nurse Rounding LeaderID] = tblPatient.fk_LeaderInitials
    WHERE (((Month([DateofRounding]))=[Forms]![frmMain_expandlg]![Subform1]![cboMonthRPT]))
    GROUP BY Month([DateofRounding]), [tblNurse Rounding Leader].NRLLastName, [tblNurse Rounding Leader].NRLFirstName;
    Click image for larger version. 

Name:	Leader screenshot.jpg 
Views:	7 
Size:	59.6 KB 
ID:	13397
    Thanks!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Need raw data to analyse. If you want to provide, follow instructions at bottom of my post.
    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. COUNT Group Count Records COUNT FUNCTION
    By PMCOFFEY in forum Access
    Replies: 9
    Last Post: 11-09-2012, 09:40 PM
  3. Count if (where?)
    By jvlajcic in forum Queries
    Replies: 1
    Last Post: 12-14-2011, 03:09 PM
  4. Count on ID
    By dssrun in forum Access
    Replies: 4
    Last Post: 07-26-2011, 11:45 AM
  5. Sum the Count
    By Adele in forum Queries
    Replies: 5
    Last Post: 07-26-2011, 06:16 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