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

    Trying to count in a query, getting incorrect information

    Here is my sql:
    SELECT Account.DBAmt, Count(Account.dbamt) AS CountOfdbamt
    FROM Account INNER JOIN Owners ON Account.member = Owners.OwnerKey


    GROUP BY Account.DBAmt, Account.Lot, Owners.OwnerKey, Owners.NoAssessments, Account.Date
    HAVING (((Account.DBAmt)=164.69) AND ((Account.Lot) Is Not Null) AND ((Owners.OwnerKey)=1185) AND ((Owners.NoAssessments)=False) AND ((Account.Date)=[Please enter last monthly assessment date])) OR (((Account.DBAmt)=54.9) AND ((Account.Lot) Is Not Null) AND ((Owners.OwnerKey)=1185) AND ((Owners.NoAssessments)=False) AND ((Account.Date)=[Please enter last monthly assessment date]));

    Here are my results. Why aren't I getting 54.90=3 and 164.69=2?? Thank you for any insights you might have!
    DBAmt CountOfdbamt
    54.9 1
    54.9 1
    54.9 1
    164.69 1
    164.69 1

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    You are grouping on fields that aren't being displayed. One of them is the culprit. Show all the fields that you are grouping on for troubleshooting.

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

Similar Threads

  1. Replies: 4
    Last Post: 01-08-2016, 10:47 AM
  2. Replies: 2
    Last Post: 02-05-2015, 03:51 PM
  3. Sum query returning incorrect answer
    By chawes40 in forum Queries
    Replies: 1
    Last Post: 12-11-2012, 03:52 PM
  4. Expression Incorrect in TOTALS query
    By SenSen in forum Queries
    Replies: 0
    Last Post: 02-29-2012, 08:46 PM
  5. Query Data Incorrect
    By Two Gun in forum Queries
    Replies: 8
    Last Post: 01-31-2012, 06:07 PM

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