How do I find ALL the positions of a certain character in a string?
Posted on 2007-03-27
I am trying to find the positions of all the $ in the summary string. I'm just doing a simple select and I am getting an error that loc1, loc2, loc3 are invalid columns. Hellllp!
SELECT [Case ID], Summary,
charIndex('$',[summary],1) as loc1 ,
charindex('$',[Summary],(loc1 + 1)) as loc2
charindex('S',[Summary],(loc2 + 1)) as loc3
FROM [tblRemedy Tickets]
WHERE Item Like '%User%' AND Summary Like '%$%';
summary = "CTSU$CSBBWWW$WCAROL$"