Can I use an Or statement in five fields?

  • Thread starter Thread starter ab
  • Start date Start date
A

ab

I have five fields (a registration table) into which registrants place
their top five topics - one in each field. However, since the applicants
can choose from ten choices, some folks have choice "A" in the first
field, others have it in the second field with choice "B" in first
field, etc. I need to end up with all registrants for choice A in one
query or report--regardless of whether choice A is their first or fifth
choice. Can I do this? I can get a query to use "or" for the first 3
columns but it won't continue to pull from columns 4 and 5. PLease help.
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I would re-design the table to something like this:

PersonID - ID of person who is ranking the topics
ChoiceRank - rank of topic
Topic - topic that is being ranked

.... other fields as required ...

Put a primary key of (PersonID, ChoiceRank, Topic) to prevent
duplicates.

The ChoiceRank column would hold the ranking of the Topic column per
PersonID. The data would look something like this:

PersonID ChoiceRank Topic
1 3 Filing
1 2 Desktop applications
1 4 Recycling
1 1 Time Management
2 2 Recycling
2 1 Payday updates

Person 1 would rank Time Management as the number 1 topic. Person 2
wold rank Payday updates as the number 1 topic.

Then to select all top ranked (ChoiceRank = 1) from the table -
something like this:

SELECT PersonID, Topic
FROM TableName
WHERE ChoicRank = 1

If you set up your tables correctly the queries are usually easier to
create.


MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQE0CGIechKqOuFEgEQJCWgCgpdUlpHkzoyKel5eDBKnlkAUnGnwAoPoC
PRFSxmX14tZT2STS1KeiLO+3
=ByfB
-----END PGP SIGNATURE-----
 
Back
Top