Results 1 to 4 of 4
  1. #1
    Gina Maylone is offline Always learning
    Windows 10 Access 2016
    Join Date
    Jun 2013
    Location
    Afton, MN
    Posts
    544

    Really weird stuff happening with a simple count in query

    Click image for larger version. 

Name:	incorrectcount.JPG 
Views:	12 
Size:	16.4 KB 
ID:	32239
    SQL: SELECT [Copy Of Account].Owner, [Copy Of Account].Lot, Count([Copy Of Account].Owner) AS CountOfOwner, Count([Copy Of Account].Lot) AS CountOfLot
    FROM [Copy Of Account]
    GROUP BY [Copy Of Account].Owner, [Copy Of Account].Lot;

    Owner is a number field, lot is a short text field. Both should be able to be counted easily. If you can't read that tiny picture I included it shows the [countofowner] =169 and the [countoflots]=169 each of them should be "2" (as the summary shows). Is this corruption?



    TIA!

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    you can't get an accurate count if you group by the same fields you want to count

  3. #3
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Can you show what the data in "Copy of Account" looks like, and what you want your expected results to look like?

  4. #4
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Never mind. I jumped to conclusions about the count in the totals row.
    Last edited by Micron; 01-18-2018 at 01:35 PM. Reason: remvoved post
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 1
    Last Post: 01-05-2017, 10:10 PM
  2. Simple stuff
    By gdemets in forum Queries
    Replies: 5
    Last Post: 12-09-2010, 09:25 AM
  3. Replies: 2
    Last Post: 05-27-2009, 08:47 PM
  4. Access Simple Stuff, help
    By clwclw in forum Access
    Replies: 1
    Last Post: 05-02-2009, 03:10 PM
  5. I need help with weird stuff happening on a DB
    By makotoshishio in forum Access
    Replies: 9
    Last Post: 04-02-2009, 12:20 PM

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