Solved

query count problem

Posted on 2013-01-16
3
318 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 143

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 143

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

821 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