Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Query to find value in ANY field?

0 views
Skip to first unread message

gdavi

unread,
Feb 12, 2003, 8:58:49 PM2/12/03
to
Is there a way to quickly write a query to find a value (or a wildcard*) in
ALL the fields within a given table?
Gary


Michel Walsh

unread,
Feb 13, 2003, 8:33:28 AM2/13/03
to
Hi,


Not with JET. With MS SQL Server, if you have installed the optional Full-Text Searching, you can
use CONTAINS() in a WHERE clause (see BOL for more details), using * as first argument:


SELECT * FROM products WHERE CONTAINS(*, ' hot AND NOT spicy ');

for those records having hot but not having spicy, or


SELECT * FROM products WHERE CONTAINS(*, ' "hot and spicy" ');

for those records having literally "hot and spicy" .


It is very versatile, since you may look for season, seasoning, seasons ...

SELECT * FROM products WHERE CONTAINS( *, ' FORMSOF( INFLECTIONAL, season ) ' )


but that become hard to ask to supply that kind of syntax from a ... non seasonal user.

Hoping it may help,
Vanderghast, Access MVP


"gdavi" <gd...@yahoo.com> wrote in message news:tZC2a.1090$8Z5....@sea-read.news.verio.net...

0 new messages