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

Locating text with a field

Status
Not open for further replies.

c0redumpt

Programmer
Feb 16, 2003
6
0
0
AU
I have a text field that has a field named ICD-Code that looks something like this:

J10 K1042J108 Z03 Z0311J14 ....

Basically a field that has multiple ICD alphanumeric codes within in where each code can be from 3 to 5 in length, where blanks are placed for codes that do not have a length of 5 alphanumerics.

I need to be able to select each record that has the code J10 anywhere in the ICD-Code field... and ensure that fields that are similar ie J108 are not included in selection?? I've looked at using LIKE and IN statements but cant get it out perfectly
 
One way (not perfect):
WHERE ICD-Code & ' ' Like '*J10 *'
Another way (safer):
WHERE (InStr(ICD-Code,'J10') Mod 5) = 1

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top