Results 1 to 3 of 3
  1. #1
    Beltramo64 is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Dec 2017
    Posts
    12

    Correct expression to count unique records in a report

    I need a little assistance currently I am using the following formula in a text field box and it works fine



    =Count([FirstLastName]) see below the output. The total I want is 11 not 22, to represent the number of unique people, not the total number of jobs they are charging to .

    Click image for larger version. 

Name:	count records.JPG 
Views:	10 
Size:	82.9 KB 
ID:	32272

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Have to do a query that returns record for each person and uses the same filter criteria as the report. Use DISTINCT or GROUP BY. Then join that query to the report's RecordSource query.
    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.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    A general SQL approach is
    Code:
    Select DISTINCT fieldname,Count(*) as [Count] from tablename group by fieldname;
    where
    -tablename is the name of the table containing the field
    -fieldname is the name of the field for which you want the distinct count

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

Similar Threads

  1. Count Unique Records Only
    By PeakH in forum Queries
    Replies: 1
    Last Post: 08-08-2017, 10:07 AM
  2. Replies: 4
    Last Post: 04-06-2016, 01:29 PM
  3. Count Unique Records in a Report
    By Mohmand in forum Reports
    Replies: 2
    Last Post: 09-10-2014, 10:44 PM
  4. Count unique records - no duplicates
    By Kevo in forum Queries
    Replies: 4
    Last Post: 08-15-2011, 01:19 AM
  5. Count Unique Records
    By PonderingAccess in forum Queries
    Replies: 2
    Last Post: 08-19-2010, 06:54 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