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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to search for a pattern within a field 1

Status
Not open for further replies.

laina222

Technical User
Sep 7, 2001
172
US
I need to be able to query a field based on text within the string.

For example, I have a field called "Weekday" which can be any of the seven days of the week (Monday, Tuesday, etc...) AND can also be a combination of two days (Saturday/Sunday), therefore I did not want to use a combo box. If I wanted to pull only the records where the day "Sunday" appeared within the field and include all of the fields where Sunday is within the string, is there a way to do that? I would want to pull all of the records where "Sunday" appeared like "Sunday/Monday" or "Saturday/Sunday".

If need be, I can clarify.

Thanks for any help in advance!
 
You need to use the LIKE operator.. so it would look something like:
select * from table where column like '%Sunday%';
 
And the syntax for JetSQL:
Like '*sunday*'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top