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

How can I search for a string that begins with a certian word? 2

Status
Not open for further replies.

tctran

Technical User
Jun 5, 2014
8
US
Hello,

I have a list of about 75 different types insulin medications and would like to query the report to look for records with medication that begins with a combination of either “INSULIN”, "Insulin" or "insulin". How can this be done in Crystal Reports?

Thank you so much in advance for any help you can provide!

Best regards,
TC
 
left({somefield}, 7) = “INSULIN". This assumes your DB is case-insensitive, If it is not, you can use the UCASE function around the field.
 
BettyJ & kray4660,

Thank you so much for the tips! I really appreciate your time.

Best regards,
TC
 
What if I want to search for the combination uppercase and/or lower case like "INSULIN", "Insulin", or "insulin"? Is there a function to look for the string regardless of the case instead of typing out all of the possible combinations? Thank you again for all of your help! :)

TC
 
If you have
[tt]Uppercase({YourField}) startswith "INSULIN"[/tt]
in the Record Selection Formula in Crystal Reports, you should be getting all the records you are looking for if it always starts with any case combination of the word "insulin" since the function uppercase will convert the values to uppercase and then compares it to "INSULIN".

If not then also try
[tt]ltrim(Uppercase({YourField})) startswith "INSULIN"[/tt]
to eliminate any blank spaces in the beginning of the medication.

If you are still not getting all the records you are looking for, please post sample data from the table.

 
Betty,

Thank you for the tip! I've got to try this out. I really appreciate all of your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top