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!

How to count instance of certain records? 2

Status
Not open for further replies.

SSSFisgard

Technical User
Nov 7, 2006
27
0
0
This is probably alot easier than my little mind can put together right now, but here's my question. I have a string field that contains 3 different values, First, Second, & Third. I need to be able to say how many times the value First is present in the report. I would ultimately like to be able to have it look like:

First Second Third
5 78 50

Hopefully someone can shed some light for me. Thanks for the help.

SS
 
Create a 3 running totals that do a count on the field. Under 'Evaluate' select 'Use a formula', and put in {field} = "value1" in the x-2 for the formula.
 
Or you could create conditional formulas like:

if {table.field} = "First" then 1

Then right click on each formula and insert a sum (not count) on the formula. This will work as long as you don't have record inflation. If you do, then you will need to use running totals as suggested above.

-LB
 
Would a crosstab work for you?

With a crosstab you wouldn't have to maintain any formulas if you add other values.

mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top