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!

Wildcard use

Status
Not open for further replies.

GMAN33

IS-IT--Management
Dec 4, 2002
115
US
Hi All

CRXI Developer, Oracle 9 DB

I have three types of patients with numbers like

02HS1234
04D02
09H2323

I need three separate reports for each of these patients and the data is all in the same table

I was able to get the first and second patients by using a record selection like:

{PATIENT} like '*HS*' as well as {PATIENT} like '*D*' for the second report, but the third one I can't figure it out since it has an "H" in it like the first report, so if I filter out "S" it gives me nothing

Any suggestions?

thanks

 
I don't follow. You'd get the third patient if you selected for patient like H and not like S.

You could also make the three reports into one report with three pages or sections, using Grouping. Does this help?

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thank you for the reply

The patient numbers that I listed could contain thousands of patients with the same format 02HS1234 to 02HS9999

Since they are all in the same field within the same table, I need to have three separate reports for each style of patient formatting like I have above.

So using the formula
{PATIENT} like '*HS*' and for the next report I use {PATIENT} like '*D*' these work fine to get what I need. But the third one I can't figure it out since it also has an "H" in it like the first report, so if I filter out "S" it gives me nothing

I am not sure if there was a better way to filter these patients possibly using another formula

Thanks again...hope this is somewhat clearer
 
Why not use a parameter and have 02HS1234, 04D02, and 09H2323, as the default values, then pull records where {PATIENT} like (@Patient)
 
I may be misunderstanding your question, but my suggestion would be to create a group formula (@Group_1)that assigns a number (1, 2, or 3) or a letter (A, B, C) to each of the patient types. The formula would be something like this (assuming that your {PATIENT} field is a string type):

If {PATIENT} startswith "02HS" then 1 else
If {PATIENT} startswith "04D" then 2 else
If {PATIENT} startswith "09H" then 3

Then just create a group on this formula. This would allow you to display all three types in a single report with summaries for each type. You might need to tweak the formula so that you get the correct field translation each time.

Again, I may not be interpreting your post correctly and this is ends up being a rather useless suggestion.
 
Thanks guys for the replies...but I am sorry if this is confusing.

The patient numbers can also be 01HS1234, 02HS1234, 43HS1234, so I think I need to do a string type of formula that looks for the HS, D and S. With the formula I was using above with the '*S*' it was leaving out both the HS and S because of the use of the wildcard
 
Try this and hope this helps you

1st report

patient number like '%HS%'

2nd Report

Patient number like '%D%'

3rd report

not(patientnumber) like '%HS%'
and
not(patientnumber) like '%D%'

 
Thanks sameer11 - I got the first two to work just find, it is this last one that is still not giving it to me...thank you again for the help
 
Try:

{table.patientnumber} like '*H*' and
not({table.patientnumber} like '*HS*')

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top