Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

SQL Server 2012 Contains / Near query

$
0
0

I'm trying to run proximity searches on a table that has a full text index.  I have no issues running the queries with single words NEAR each other but when I'm trying to locate a multiple word phrase near another multiple word phrase.  I am getting syntax errors and when I quote around the phrase it bring back results for any of the words showing up at all in the text field.  Here's my query:

select *
  from tblClients M
        join tblUser U on U.UserID = M.UserID
  where M.EDate between '2015-01-01' and '2015-5-31' 
        AND Contains([fldcomments],'NEAR((working with, contact customer),25)')

Any assistance would be appreciated,

Pete


Viewing all articles
Browse latest Browse all 4871

Trending Articles