Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Statement that searches the same column for multiple values

Status
Not open for further replies.

jillallynwilson

Programmer
Apr 14, 2004
21
0
0
US
I need to search one field for multiple values. For example, user enters search query as 'apples and oranges'. The field lists the value a '1 apple, 2 grapes in oranges'.

Below is the statement that I am trying but I am not sure if the CONTAINS syntax is correct or even valid. I found this option on related T-SQL (Transact-SQL) sites and I am not sure of the difference between SQL and T-SQL.

SELECT * FROM LIB.FILENAME WHERE CWTYPE = 'M' AND CONTAINS(Ucase(CWFULLDESC), ' "APPLES" AND "ORANGES" ')

Should the above work, if not, do you know the correct statement to use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top