Hello All,
I have a Query that has 5218 rows. I just wanted to display the
row count on a form.
DCount("[SomeField]", "TheQuery") returns --> 5095.
DCount("*", "TheQuery") returns --> 5095.
There are NO Nulls in [SomeField] !
That doesn't seem right at all.
Additionally, the query contains exactly two rows for each unique
occurrence of [SomeField].
This shows that the "missing" 125 rows in the query have only
one occurrence of [SomeField]. [SomeField] is a text field (8 characters)
with no Nulls.
However, this:
Produces 5218 rows, in perfect pairs. The DCount will work fine when
using the table.
The workaround was to use a Recordset to get the count, but
I'm a little confused as to why the DCount doesn't work
properly AND as to why the Count(*) returns "bad" results.
Any ideas?
Wayne
I have a Query that has 5218 rows. I just wanted to display the
row count on a form.
DCount("[SomeField]", "TheQuery") returns --> 5095.
DCount("*", "TheQuery") returns --> 5095.
There are NO Nulls in [SomeField] !
That doesn't seem right at all.
Additionally, the query contains exactly two rows for each unique
occurrence of [SomeField].
Code:
Select [SomeField], Count(*)
From TheQuery
Group By [SomeField]
Order by Count(*) ASC
This shows that the "missing" 125 rows in the query have only
one occurrence of [SomeField]. [SomeField] is a text field (8 characters)
with no Nulls.
However, this:
Code:
Select *
Into NewTable
From TheQuery
Produces 5218 rows, in perfect pairs. The DCount will work fine when
using the table.
The workaround was to use a Recordset to get the count, but
I'm a little confused as to why the DCount doesn't work
properly AND as to why the Count(*) returns "bad" results.
Any ideas?
Wayne