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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Single count of multiple items in a database

Status
Not open for further replies.

byteofram

IS-IT--Management
Jan 23, 2002
41
US
I have a database that has audited the .EXEs on all the machines in the company. Within the database some machines have multiple occurences of the same .exe, but I only want to count that as 1 for that machine. I have the report where it will print out only 1 occurence, but it is still counting the multiple occurences. Example:

MACHINE1 TIGER.EXE
MACHINE1 CAT.EXE
MACHINE1 TIGER.EXE
MACHINE2 TIGER.EXE

Report should show:

TIGER.EXE 2 (not 3)
CAT.EXE 1

Can anyone help?
 
You could try the following:

Create Group 1 on {table.exes} and then Group 2 on {table.machine}. Then insert a running total and select {table.exes}, count, on change of group #2 (Machine), reset on change of group #1 (Exes). Place this in the Group #1 footer and suppress the details.

-LB
 
OK - if you're grouping by machine, then change your summary field (in the group footer) to distinct count instead of count. That should take care of any summaries.

If you're not grouping, or your problem lies with a grandtotal, then simply changing it to use distinct count probably wont help - in your example above a disticnt count would return 1 x TIGER.EXE and 1 x CAT.EXE.

This may seem a little ugly, but what you really want to count is a combination of both fields (machine and application), so I'd do just that; Create a formula that adds the two values together in a single string, add it to your detail section, then insert a grand total using distinct count on the new formula. You can always supress your formula then.

Peter Shirley
 
Thanks for the help...appears to be working.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top