Solved

query count problem

Posted on 2013-01-16
3
317 Views
Last Modified: 2013-01-17
hey guys,

i've got a weird problem with a totals count query.

below is my QBE design view
picand here's the data table i get from this query
Count-Problem.xlsx

question: how come my count for Team Member W is sometimes 2 or 1 but the rest is all 1? account # is only in tblDataStorage and the primary key is the ID field. even after including the ID field in the query as a group by field, i can still get 1 row of ID but count of 2 for account number. if the count is really 2 for account number, then i should have 2 ID fields right? and 1 record can only have 1 account # (i've also taken the extra measure to verify this. so how come i'm still getting a count of 2? this is most perplexing!!! (i thought i was trained up well enough by EE already but seems like i'm still not good enough to solve this ha = (   )
0
Comment
Question by:developingprogrammer
  • 2
3 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 38786104
remove the group by (and count) function, to run the query to show the plain data.
you will see that you will have several rows for the same "group" of data, considering all fields that you are grouping by.

usually, with joining multiple tables, this is because one or more of the linked tables has indeed several records for the grouped ID ...
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 38786106
though this article is not about ms access in particular, it may help understanding the issue:
http://www.experts-exchange.com/Database/Miscellaneous/A_3203-DISTINCT-vs-GROUP-BY-and-why-does-it-not-work-for-my-query.html
0
 

Author Comment

by:developingprogrammer
ID: 38786133
thanks angelIII

yup i did more testing and turned off the Totals and realised that the staff was entering the codes wrongly thats why for 1 ID field there were 2 codes e.g. LVA / PA so there were 2 ID rows with the same ID.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now