Multiple criteria in field

  • Thread starter Thread starter Peggy
  • Start date Start date
P

Peggy

I have a database with last names in one column and class
periods in the second column. Some students are in more
than one class. I want to put both class periods in the
same field, but ask the query to pull only the one I'm
asking for. For instance: There are 10 students in
period 1 and two of those students are also in period 6.
I want to show 1,6 in the period field, but ask the query
pull only period 1 in the list. Is that possible?
 
Word of advice....do not do this! A relational database is designed for one
value per field per record. Don't combine things...it's very difficult to
extract the data (as your question indicates).

Set up a junction table for managing this many-to-many relationship between
students and classes:

tblStudClass
StudentID (composite primary key with ClassID)
ClassID (composite primary key with StudentID)

Then link this table back to the other tables using these fields. Your query
then will be very easy to set up and run.
 
Back
Top