Count all records with the same project name (1 Viewer)

GrahamUK33

Registered User.
Local time
Today, 16:08
Joined
May 19, 2011
Messages
58
I have a report with a record source coming from a query, within the query there is a field called ‘Project’. What I would like to do is count all records with the project called ‘Car’ and display that number in a textbox within the report.

So far I have tried the following, neither of them work.

=DSum([Project],'Car')
=DCount("[Project]", "Car")

Any idea what expression I will need?
 

GrahamUK33

Registered User.
Local time
Today, 16:08
Joined
May 19, 2011
Messages
58
I have just found the following that works, I hope this helps someone else with the same issue.

=Count(IIf([Project]="Car",0))
 

GrahamUK33

Registered User.
Local time
Today, 16:08
Joined
May 19, 2011
Messages
58
I have reopened this, the above solved my issue for a bound report, but now I have the same problem for an unbound report.

I have managed to get to code for a TextBox that displays total records within table which is shown below, but I would still like to find all the records within ‘ProjectID’ for ‘Car’.
=DCount("ProjectID","tblExample")

This returns the value of ‘0’, it should return over 200.
=DCount("ProjectID","tblExample")="Car"
 

GrahamUK33

Registered User.
Local time
Today, 16:08
Joined
May 19, 2011
Messages
58
I have found the following code has solved my issue.
=DCount("*","tblExample","ProjectID=Car")
 

Users who are viewing this thread

Top Bottom