2
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" because there is no "»"
On the second Row I need to pick up "Farmácia Popular" for 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 did not succeed.
Use
substring
andcharindex
right that works– Lucas Fontes Gaspareto
Could you give more details about the structure of your database? How is this table
Solicitacao
?– Victor Stafusa
Do you want to seek the "END" where? In the Solcaminho?
– Victor Stafusa
Friends, I’ve asked the question again...
– Vinícius Fernandes
Asked how the query was after the changes
– Tiago Oliveira de Freitas
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