Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Substring & Charindex

$
0
0

SSRS05

I trying to do a select from the first character after a space in a concatenate variable @name. You can see it has variable length and the space is either in position 2 or 3.

@name = 1 companyaaaa

             2 companycccc

             12 companyxxxxxxxx

             13 companysssssssssssssss

select *
from companies
where companyname = substring(@name,charindex(' ',@name,1),LEN(@name))

this is not working, thanks.


Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>