Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Counting distinct Dates whileprintingrecords


I have a report where I have it grouped by patient and then by date of service and cpt code. For each patient I want to know if they had any number of cpt codes, but they need to be from two different service dates.

My report looks a bit like this.

Patient #1

Date1 CPT1

Date1 CPT2

Date2 CPT3

Date2 CPT4

Patient #2

Date1 CPT1

Date1 CPT2

Date1 CPT3

I want to count the number of dates of service and show only those who have more than one date of service. I'll suppress those with only one date of service. So, in the above example, Patient 1 should show on the report, but Patient 2 will become suppressed.

My thought was to perform a manual running total to count the distinct number of dates, but I can't get it to increment correctly. Am I on the right track? or could there be another way to handle this?



Former Member
Former Member replied

No no, forget the running totals of any kind.

Do it all in the query:

Select ....


or, put this in the Record Selection formula

(this is not a running total)

"Where Not IsNull(Date1) And

Not IsNull(Date2) And

Date1 not equal Date2"

That way you filter the data before it hits the report.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question