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!

Getting a part of string

Status
Not open for further replies.

ahadali79

Programmer
Aug 16, 2019
1
0
0
US
Hello,

I need to get a part of a string and I am having a hard time

my string value is '18-18-5-4.5-35 MEQ/20 ML' and I need to get 'MEQ'

I used
LEFT(column_name,CHARINDEX('/',column_name) - 1) and I get '18-18-5-4.5-35 MEQ'

Any help is appreciated.

Thanks,
Ali.
 
Also of note here is that there are database-specific syntax to assist with string manipulation, but they are not ANSI - they are database specific. For instance, CHARINDEX (T-SQL) and INSTR (PL/SQL) do the same thing; they find the location of a substring within a string.

==================================
advanced cognitive capabilities and other marketing buzzwords explained with sarcastic simplicity


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top