Searching all fields in a record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there an SQL statement where I can search all fields in a record without
specifying the field names?

such as: Select * from
where * is like "whatever"

I would like to use a simple query as the field names can change from time
to time and I don't want to rewrite this query every time.

Thanks in advance.

TimW
 
Tim

A couple red flags went up when I read your post.

First, a database design that puts values in any field requires searching
"all fields". This sounds very much like ... a spreadsheet, not a
relational database!

Second, have field names that "change from time to time" doesn't sound like
the data structure has been finalized. If you provide some examples, the
newsgroup may be able to offer some suggestions.

Good luck

Jeff Boyce
<Access MVP>
 
Is there an SQL statement where I can search all fields in a record without
specifying the field names?

such as: Select * from
where * is like "whatever"

I would like to use a simple query as the field names can change from time
to time and I don't want to rewrite this query every time.


If you're using fieldnames as data, or as variables, you can't.

In a properly normalized database this search should essentially NEVER
be necessary. If you have your Entities and their Attributes properly
defined, then you know where you want to search - you wouldn't search
the StreetAddress field for a telephone number, or the DepartmentID
field for a LastName!

I wonder if a simple Query By Form (which lets you search any field or
any combination of fields) might be the best solution for your
problem.

John W. Vinson[MVP]
 
Back
Top