How would I substitute the '%and%' with a variable like:
declare @PWORD varchar(10)
set @PWORD='and'
select title_id,
substring(notes, (PATINDEX('% @PWORD %', notes)-25),
(PATINDEX('% @PWORD %', notes)+24))
FROM titles
where PATINDEX('% @PWORD %', notes)>0