471,571 Members | 2,662 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,571 software developers and data experts.

charindex question

I have a field containing a string with '/' in it multiple times.

How can I return the charindex of the last occurance of '/' in the
string?

Regards,
Ciarán

Mar 21 '06 #1
1 2332

declare @s varchar(10)
set @s='as/gf/af/h'
select len(@s)-charindex('/',reverse(@s))+1
Madhivanan

Mar 21 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by M Wells | last post: by
2 posts views Thread by Little PussyCat | last post: by
5 posts views Thread by Willem | last post: by
3 posts views Thread by csomberg | last post: by
1 post views Thread by jeremy | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.