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!

Counting using Multiple Criteria 1

Status
Not open for further replies.

Kim296

MIS
Aug 24, 2012
98
US
I am trying to count using a set of multiple criteria and would appreciate any help available. I work at a county jail and have a report showing who has come to jail on what charges by date. The booking_id is unique to a person, but can be used multiple times for each arrest by date. For example John Doe, booking id 123, may have come to jail 3 times this year. If I distinctcount booking id's then it would only count John Doe one time.

Does anyone know how I would count the record if it is a unique combination of date arrested and booking id? In excel, I could use sumproduct, but that function doesn't exist in the crystal reports environment.
 
Create a formula which concatenate date and ID togther and then do a unique count on that

@NewId
totext(ID, 0,"")+totext(date, 'yyyyMMdd')

or use a Running total which evaluates on change of date and resets on change of ID

Ian
 
Thank You Ian!!

I tried for hours to figure this out yesterday. Your solution worked PERFECTLY. I appreciate your help.

Thanks
Kim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top