search rows to see if name shows up in any column

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

Guest

I have two tables, one with info about certain events and the other with a
list of names. How can i query the events table to find all the rows where
each name comes up at least one in that row. the names could be in any of
those columns in each row. how can i do this? it would even be fine if i had
a separate query for each name, and each query showed every event where the
name was somewhere it that row. Thanks!
 
Jesse said:
I have two tables, one with info about certain events and the other with a
list of names. How can i query the events table to find all the rows where
each name comes up at least one in that row. the names could be in any of
those columns in each row. how can i do this? it would even be fine if i had
a separate query for each name, and each query showed every event where the
name was somewhere it that row. Thanks!

Why is a name "somewhere in that row"? Don't you have the table
Normalized? Can you show use the structure of the tables, some sample
data? Right now your description is vague.
 
The name is "somewhere in the row" b/c it can show up in mulitple columns.
There are about 4 different columns in which the name could show up.

DATE | SITE | CONTRACT # | NAME | NAME | NAME | NAME

that is how the table is basically setup. that represents a row in the tabel
and the name could appear in any of those name columns.
 
So, the hunch of MGFoster is correct, you do NOT have normalised data.
Access, or any RDBMS requiers the data to be normalised before you can make
use of it in any meaningful way

If I were you I'd restructure the data before getting to far. For example,

tblSite
SiteID, SiteName . . .

tblContacts
ContactID, ContactName

tblSiteContact
ContactID
SiteID

you get the gist.
 
Back
Top