June 11, 2004 at 7:32 am
guys,
using select statement how can i search for a field that contains the '%' string? It gives me an error since the search parameter itself is % used in the like statement.
thanks
- Satish
June 11, 2004 at 7:35 am
From BOL under escape Characters
You can search for wildcard characters. There are two methods for specifying a character that would ordinarily be a wildcard:
WHERE ColumnA LIKE '%5/%%' ESCAPE '/'
In this LIKE clause, the leading and ending percent signs (%) are interpreted as wildcards, and the percent sign preceded by a slash (/) is interpreted as the % character.
WHERE ColumnA LIKE '9[-]5'
hth
Tal MCMahon
June 11, 2004 at 7:40 am
Thanks Tal. That worked like a charm !
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply