HELP WITH CRITERIA SELECTION

I am attaching the code that I used in this report. I would like the following information in the procedure code field: Only those patients who were charged for a 99213 and a 52000 or 99212 and 5200 only.

In my report I am seeing patients that have JUST a 99212 or 99213 only and patient that have a 5200 and 99212 or 5200 and 99213. I want someone that has the combination. See Acct # 27039. I know that the problem is that i selected IS ONE OF for my formula but I don't know how to fix. Some suggested doing a DO WHILE command but I don't kow how to use that.

You can't use a record selection formula for this. Record selection rules work on individual records and not on groups of records so the rules can't refer to the content of other records in the same group.
You could use a group selection rule in CR. To do this you would have to have separate formulas which counted the number of "52000"'s, "99212"'s, and "99213"' in the group and then base the group selection on the results of those formula fields.
You can achieve the same thing using the Add Command option to select the data for your report, where you could write a sql statement using 'groupBy' and 'Having' clauses.

If an account has all 3 values in the group is the account to be included or excluded?

Hi
On the right hand of the screen under the list of database fields you will find formula field.
right click and make a new one.

Your formula will be something like
If (some field) = x and (some other field) = y then "Good Record" else "Bad Record"
Then in your select expert you can use the formula you just made and filter for only "good record"

Group all data by Account, then by date.
This will allow you to consider what orders each account placed on each day.

Make a few formula
if account = "52000" then 1
if account = "99212 then 1
Then another one to add these two together. Call it "summary" or something
Place all of these formulas on each individual line of data. Thats 3 formula on each line.
Then in the group footer for date, the second grouping level, add a sum of "summary"
Records where this "summary" are greater than 2 are of interest.
Right click on this summary in the date footer and select "select Group Expert"
This is like the selection expert but you can exclude groups, instead of single records. Exclude groups with that summary of less than 1.

It works for what you have, although its not a glamorous solution and might fall over should you have multiple orders of the same item on the same date, but its the best i can do!

mlmcc: Yes you can have individual codes for each person based on DOS(date of service - see below) but I only want the combination of 52000 & 99212 OR 52000 & 99213 and what my report is showing me is all the individual codes and then the combination I am looking for. All by Date of Service which is what I want. So reports looks like this:

Date of Service Acct # Procedure Code
3/25/2008 27039 52000

6/3/2008 27039 99213

9/30/2008 27039 99213
27039 52000

All I really want to show on my report is the one for DOS: 09/30/2008 where the patient was billed for the codes 99213 and 52000. I need my report to show this combination
or the combination of 99212 and 52000 like this one:

Hop5: I created the formulat for 52000 = 1 and 9213 = 1 and the summary for adding both and added to the footer but when you say:
Right click on this summary in the date footer and select "select Group Expert"
This is like the selection expert but you can exclude groups, instead of single records. Exclude groups with that summary of less than 1.
When I right mouse click I do not get the option of "select Group Expert" but I selected from the toolbar but I don't understand how to type in the exclusion part.

Well I finally got it. I left my formula as before see snippet below but in the Date group footer I added a summary of distinct count of ARCHRG.PROC_CODE and then I used select expert and select "is equal to" 2.00 and suppressed that footer.

That gave me what I wanted. Thanks to every one. Especially Hop5 your answer was what I concentrated on the most.
Kate

Crystal Reports: 5 Tests for Top Performance
It is complete, your masterpiece report. Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways.
…

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples).
Crystal Reports uses a two-pass reporting process to provide greater …

Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB.
To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…