I've used CHARINDEX for years, but came across a need to use a FILTER with a WILDCARD with CHARINDEX and found that it would not support it.
Enter: PATINDEX.
We'll use this article to put up tips on the uses of CHARINDEX and PATINDEX, for today this piece of code. The Task is to find 'INV12345678' in a notes field using wildcards and retrieve the invoice number for a report.