Results 1 to 7 of 7
  1. #1
    Miskondukt is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    21

    Unique Values Count still counting duplicates

    Lo All o/



    I am trying to get an accurate count of unique values (in a single field, such as "Order Numbers" & "Won") and am not getting the right results. I have attached five screen shots:

    1. The inaccurate results of the intended distinct count query
    2. The query design view for 1.
    3. A validation query I ran showing the correct number of total order numbers
    4. The query design view for 3
    5. A pivot report I created in Excel as a redundant validation


    1 should match the result of 3 & 5, but it isn't and in 2's query I have tried both unique values & unique records. What might I be doing wrong?

    Thank you kindly

    Click image for larger version. 

Name:	DCount1.png 
Views:	15 
Size:	15.4 KB 
ID:	30393

    Click image for larger version. 

Name:	DCount2.jpg 
Views:	15 
Size:	78.9 KB 
ID:	30394

    Click image for larger version. 

Name:	DCount3.png 
Views:	15 
Size:	8.8 KB 
ID:	30395

    Click image for larger version. 

Name:	DCount4.jpg 
Views:	15 
Size:	85.9 KB 
ID:	30396

    Click image for larger version. 

Name:	DCount5.png 
Views:	15 
Size:	15.2 KB 
ID:	30397

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Leave out distinct and unique values - this is a simple totals query. Decide which fields should be unique and group by them. It looks like you are trying to get a count by agent and period, group by those and count the orders. What is wrong with your first two screen prints?

  3. #3
    Miskondukt is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    21
    The first two screenshots count the duplicate order numbers, most particularly quotes since there are multiple quote versions, thus why I am trying to grab the distinct counts (there are also, quite seldom in comparison, more than one "order") of order numbers.

    Click image for larger version. 

Name:	DCount6.png 
Views:	15 
Size:	62.6 KB 
ID:	30398

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Create a first query to select the distinct values. Still struggling to get exactly what you want to count. Would C34780 be counted as a 1? Are you trying to ignore quotes (that would be in the criteria)?

  5. #5
    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,725

  6. #6
    Miskondukt is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    21
    Quote Originally Posted by orange View Post
    What field(s) should be counted as unique---simple, plain English?
    Or.der.Num.bers ... per period & agent.

  7. #7
    Miskondukt is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    21
    Quote Originally Posted by aytee111 View Post
    Create a first query to select the distinct values. Still struggling to get exactly what you want to count. Would C34780 be counted as a 1? Are you trying to ignore quotes (that would be in the criteria)?
    I am trying to count unique order numbers per agent & period (quarter) because (a) the raw data lists multiple versions of quotes so multiple records and (b) NOT every order was originated from a quote thus why I need to include both quotes and orders, but the unique count of said order numbers.

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

Similar Threads

  1. Replies: 6
    Last Post: 04-08-2016, 07:32 AM
  2. Counting unique values in a query
    By DHIGHTO in forum Queries
    Replies: 4
    Last Post: 01-21-2015, 08:19 AM
  3. Using Criteria to Count Unique Values
    By bryan0 in forum Queries
    Replies: 1
    Last Post: 07-21-2014, 12:43 PM
  4. Count unique records - no duplicates
    By Kevo in forum Queries
    Replies: 4
    Last Post: 08-15-2011, 01:19 AM
  5. Count of Unique Values
    By vsmk in forum Queries
    Replies: 2
    Last Post: 03-14-2010, 12:07 AM

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