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

Query to Show Fields with particular content

Status
Not open for further replies.

matthoward

Technical User
Nov 21, 2002
22
GB
I am looking for a query which most people probably no the answer to but I am having a mental block on. I need to be able to run the query so it will bring up all records with the name "Trust" in the field. The other question is how do I do a query to exclude certain records that contain a particular field as I now how to include to certain records which contain content not vice versa. For example
A table which has product type. contains fields atn, atx, atw, btw, bcw, zzz, ttt, def,
I need to find a way to not display btw and bcw fields.

Cheers and thanks heaps in advance Matt
 
>> I need to be able to run the query so it will
>> bring up all records with the name "Trust" in the field

select foo, bar, qux
from yourtable
where thefield like '*Trust*'

>> I need to find a way to not display btw and bcw fields.

select foo, bar, qux
from yourtable
where thefield not in ('btw','bcw')


rudy
 
Wat is "select foo, bar, qux", Sorry for sounding dumb,

Cheers Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top