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

STRING EVALUATION QUESTIONS 1

Status
Not open for further replies.

lareya

Technical User
Jan 30, 2003
49
US
Hi,
I have a report with this type of set up. These are all different types of procedures sorted by their table as to what they are. general surgery, ent surgery, gyn surgery, and ortho surgery....ect. I have about 10 different types of surgery. I call them by their procedure_ID
{PROCEDURES.PROCEDURE_ID}
GEN CB2EZ 095423
ENT EB1FEZ 915320
GYN BB1UZ 085362
ORT AA6Z 118932

okay, I actually put in the spaces to SHOW that each of these actually mean something. But they are really all together LIKE THIS GENCB2EZ095423

Now, how will I be able to access these different parts.

The first 3 will always be 3 letters
The next section will not be the same length, but it always ends with a Z (that is the stop point)
The last part that follows the Z will always be a number.
I am interested in reporting on the first two sections.

I have been trialing and erroring w/mid, Left, Right and they are helpful. but what i really need is to be able to use them in conjuntion.

Example:
MID({PROCEDURES.PROCEDURE_ID}, 4,6) gives me kinda what I need, but what do I do to actually find Z which is my stop point? It is a string, but it really is used as a delimiter.
I need to search the individual surgery type, and then I need to sort the different types of surgery within the catagories, and then count, sum, etc.,

GEN (general surgery)
GENCB2EZ095423 (appendectomy)
GENCB2FZ68542 (cholecystecomy)
GENCB1FZ98521 (biliroth)

and the same with all the different service.

The first two sections in the procedure_ID, tells what service, and what type. so I can report on all the abdominal cases, all the laparscopic cases, all the hand etc., that is why they are named this way.

I know I am making little sense here. If someone can ask me questions, I may be able to explain it better, so YOU can help me better. Please see my sig for the applications I am using.

I appreciate all the help anyone would like to give!

Lareya

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Crystal 8.5; ORSOS/One Call Hospital Scheduling System v9.3; SQL database; Huge Newbie to Crystal! Operating Room RN Analyst
 
For your Group #1, you can use:

left({PROCEDURES.PROCEDURE_ID},3)

For your Group #2, use:

mid({PROCEDURES.PROCEDURE_ID},4, instr({PROCEDURES.PROCEDURE_ID},"Z")-3)

-LB
 
Okay, Group #1 Works the way I want.

But Group#2 yields nothing. I don't get an error either., but I don't get any results.

Thanks,
Lareya

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Crystal 8.5; ORSOS/One Call Hospital Scheduling System v9.3; SQL database; Huge Newbie to Crystal! Operating Room RN Analyst
 
My bad! I do get an error, when I try to refresh with the lightening bolt. Not when I am in the formula editor.

Error: string length is less than 0 or not an integer

so I did this:
NumericText ( mid({PROCEDURES.PROCEDURE_ID},4, instr({PROCEDURES.PROCEDURE_ID},"Z")-3))

which resulted in the same error message when I refreshed. I am sure that i have no 0 length string. so what could I do next?

Thanks!

Lareya

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Crystal 8.5; ORSOS/One Call Hospital Scheduling System v9.3; SQL database; Huge Newbie to Crystal! Operating Room RN Analyst
 
Please copy your formula into the thread, because it tests out here when I try it.

-LB
 
Okay,
maybe that was the problem. I just recopied the formula, and now it is giving me group 2.

Thank you very much!

Lareya!

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Crystal 8.5; ORSOS/One Call Hospital Scheduling System v9.3; SQL database; Huge Newbie to Crystal! Operating Room RN Analyst
 
May I ask you another question?

I want to find all laparscopic cases. They will start with this: GENAB1

so when I write this in the selection editor (marbles)
{PROCEDURES.PROCEDURE_ID} = "GENAB1*"

I yield nothing.

Lareya

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Crystal 8.5; ORSOS/One Call Hospital Scheduling System v9.3; SQL database; Huge Newbie to Crystal! Operating Room RN Analyst
 
Try:

{PROCEDURES.PROCEDURE_ID} startswith "GENAB1"

-LB



 
Perfect! works like a charm. I never noticed that was in there before?!? very cool!

Lareya

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Crystal 8.5; ORSOS/One Call Hospital Scheduling System v9.3; SQL database; Huge Newbie to Crystal! Operating Room RN Analyst
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top