Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count certain fields in a report

Status
Not open for further replies.
May 19, 2003
27
0
0
US
Report includes field called "TYPE" when a report is shown the "TYPE" field has many records ex:(pc, monitor, printers, etc.)

If I wanted to only count dogs how would I go about doing that in a report.

This will be done in the section footer of the report??? so that it counts each department individually
 
In the section footer of your report, put a textbox in and set the controlsource to =Count("*", "Tablename", type='PC'")
to bring a count of all PC's in.

With a more summary report however, you could create totals using the Group By statement.

John
 
Sorry, make that

=DCount ("*", "Tablename", "type='dogs'")

John
 
How about if im running a query in my report .... its a parameter query. I select between to locations and I only wanted to count the ones for each location
 
I would use a report selection form to let you enter the different locations and build an appropriate selection. Basically the statement has to look something like:

=DCount ("*", "Tablename", "Between 'cats' and 'dogs'")

John

 
Hmm....not quite sure I understood that. Maybe i didnt ask my question right. This
=DCount ("*", "Tablename", "type='dogs'") counts all of the records in the table. But when I open my report I have to input a location "LA" or "CV" then it generates the info i asked for. when I input "LA" or "CV" I just want to get a total count for city I inputed.

I hope that was a lil bit clearer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top