Results 1 to 4 of 4
  1. #1
    Fahad313 is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    2

    I cant group by count a query with a OR criteria

    can somebody help me with this problem:
    I created a query from a query and a table. it has many criteria using the OR criteria. i grouped the Primary key by a Count total. when i run the query, it gives me the total of each record. i want it to show me the count of all the records.



    Attached Thumbnails Attached Thumbnails aaa.png  

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    As you have discovered, using "Count" in a query counts unique data. Each record's PK is going to be unique and its count will always be 1.

    I would use VBA behind a form to get a count of records within a recordset.

  3. #3
    Fahad313 is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    2
    thanks
    but i am not expert to use vba

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    You could try adding an alias to your Totals Query. Include the DCount function within your alias. This may cause a noticeable performance hit.

    MyCount: DCount("Patient ID","Included Patients Query","Patient ID >0")

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

Similar Threads

  1. Replies: 2
    Last Post: 07-24-2014, 03:37 PM
  2. COUNT Group Count Records COUNT FUNCTION
    By PMCOFFEY in forum Access
    Replies: 9
    Last Post: 11-09-2012, 09:40 PM
  3. Replies: 3
    Last Post: 04-19-2012, 01:22 PM
  4. nested query: avg, count, group by
    By gap in forum Queries
    Replies: 2
    Last Post: 07-05-2011, 07:48 AM
  5. Query to group and count field entries
    By newtoAccess in forum Queries
    Replies: 4
    Last Post: 11-29-2010, 09:19 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