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

In String comparrison "URGENT"

Status
Not open for further replies.
Jun 26, 2002
77
US
I am trying to extract a word from a string field. I have a field called "Software" which is a string field and can inclue data such as "Access", "Microsoft Access", "Microsoft access professional", etc., etc.

Which I need to do is if the word "access" is in the string then output "access".

I have tried in instr formula, but it is not working.

Thank you.
 
Please explain so your post becomes meaningful to others.

-LB
 
The instr formula does work.

I used the formula as follows:

if InStr ({'Software_Installation_Count_'.SOFTWARE NAME},'Microsoft Access Professional',1) > 0 then "Microsoft Access Professionsl" else
if InStr ({'Software_Installation_Count_'.SOFTWARE NAME}, 'Microsoft Access',1) > 0 then "Microsoft Access" else
if InStr ({'Software_Installation_Count_'.SOFTWARE NAME},'access',1) > 0 then "Access"

I found that I had to put the software names in order by the longest string first to get the correct results. If I changed the order to Access, Microsoft Access, and then Microsoft Access Professional. All of the results above would of been Access.

The number 1 allows the string to be case-insensitive.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top