Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 437
  • Last Modified:

substring and charindex

Experts! I need to get a substring from right to left intil the first charindex '\'. Example:
'\\cdw22\personal3$\JMARTINEZ3', will look like this: 'JMARTINEZ3'. LEN of characters are not fixed. Thanks!
0
marshaklana
Asked:
marshaklana
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
this will do:
select reverse(  left(    reverse(yourfield) , charindex('\', reverse(yourfield))-1)) from yourtable

Open in new window

0
 
czlongCommented:
What if we want to get "personal3$", how would that be done?
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now