Even if it was returning values,
DCount("[PONo]","CurrentStatement","[ARCode]='4'") will NOT give you a
"count of each unique PONo". It will give you a count of how many rows in
CurrentStatement have a value of '4' for ARCode and a non-null value for
PONo. In other words, if you've got 423 rows in the table with ARCode
equal to '4' and all 423 of those rows have a non-null value for PONo,
DCount should return 423. If 418 of those rows have non-null values, and 5
have Null for for the field, DCount should return 418.
To count Distinct values, you'll need to create a query that returns
unique combinations of PONo and ARCode and run DCount on that:
SELECT DISTINCT PONo, ARCode FROM CurrentStatement.
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
GD said:
PONo: Text
ARCode: Text
Table is CurrentStatement
DCount("[PONo]","CurrentStatement","[ARCode]='4'")
I'm trying to get a count of each unique PONo, where the ARCode field
equals
4.
--
GD
John W. Vinson said:
For some reason, it's bring back no results, when there should be 784
records
returned (i.e. all ARCode 4s). What could be causing that?
Please post the datatypes (NOT the Format, which is irrelevant) of the
relevant fields and the actual Dcount expression that you are using.