5
Good morning, I need a way to get all the rest of a string after a certain character, for example, I have the following database
I always need to find what’s left of the string after the last "»" that is, for the first line I needed to pick up all "Access to the system" as it does not have "»"
On the second Row I need to pick up ONLY "Popular Pharmacy" because it is after the ULTIMO "»"
So far I have the following query
select TOP 10 COUNT(SolID) as soma, SolCaminho as caminho
from Solicitacao where
DATEPART(m, SolData) = DATEPART(m, DATEADD(m, 0, getdate()))
AND DATEPART(yyyy, SolData) = DATEPART(yyyy, DATEADD(m, 0, getdate()))
and UsuIDGrupoRespConclusao = 2655
group by SolCaminho order by soma desc
I tried to do with SUBSTRING with Charindex but I was not successful. I posted this question here some time ago but I did not obtain result.
Thank you.
Has any response helped solve the problem and can address similar questions from other users? If so, make sure to mark the answer as accepted. To do this just click on the left side of it (below the indicator of up and down votes).
– Sorack