Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple "Yes/No" Query 1

Status
Not open for further replies.

LHume

Technical User
Apr 16, 2001
3
US
I have a flat file with 200+ records. Each record has a person's name, tel, e-mail address, office, and then 15 different committees a person can volunteer to work on. Each committee is a Yes/No selection. Some individuals have only specified to serve on one committee where others have chosen to work on up to 4 different committees. How do I construct a query/report to give me a listing of those individuals who've volunteered to serve on multiple committees?
 
LHume,

The value for a yes is -1 and No = 0.

Your query could include a new column:
Code:
  NumComms: -1 * ([Comm1] + [Comm2] + ... [Comm15])

The
Code:
 '[comm1]'
would be the field name for each yes/no field. Multiplying by negative one gives you a positive integer for a result.

The result in this column would be the number of commitees each person is on.

NOTE: There is a limit to the length of a string you can put in a Field Name. With 15 Committees you may have to use aliases in the query to replace the Committee field names. For example, [ResearchCommittee] becomes
A: [ResearchCOmmittee]
Then, in your NumComms field, the field name becomes
Code:
  NumComms: -1 * ([A] + [B] + ... [O])

HTH
John

Use what you have,
Learn what you can,
Create what you need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top