How can I get some text between two known words?
Sub-select example:
(SELECT TOP(1)Note
FROM Clients
WHERE (ID=@ID) AND (Note IS NOT NULL) AND (Note NOT
declare @start varchar(100)
set @start = 'startword'
declare @end varchar(100)
set @end = 'endword'
SELECT TOP(1) Note , substring( LEFT(note, charindex(@end, note, CHARINDEX(@start, note))-1), CHARINDEX(@start, note) + len(@start), LEN(note)) result
FROM Clients
WHERE (ID=@ID) AND (Note IS NOT NULL)