discrepancy between count and group by

F

F0zziebear

I seem to have a discrepancy of 1 depending on if I run a query using the
'count' option or the 'group by.' Can someone explain why this is and how to
solve it?

My report statistics are being questioned yet I know the calculations are
correct.

Many thanks

F0zz
 
L

Lance

A count will give you a count of the total number of records.
Group by will "merge" identical records, only displaying 1 record regardless
of how many actual records are in the table.

For example consider the simple table of:

Field1
A
B
C
A

A count of Field1 will return 4, but grouping on Field1 will return only 3
records.

You probably have two records with identical data. Run a duplicate record
query and see if you can find one ( there's a wizard for it ).
 
P

Pat Hartman

You also could get different results if you use Count(*) than if you use
Count(FieldName)
The * includes null values in the count whereas the specific field name
omits null values.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top