A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

querrying for a specific field



 
 
Thread Tools Display Modes
  #1  
Old June 11th, 2004, 02:07 PM
Bill Pratt
external usenet poster
 
Posts: n/a
Default querrying for a specific field

I am just beginning with Access but have gotten accustomed
to the basics really quick. I am working on a database
that has 25-30 fields, many of which are yes/no fields. I
have worked with queries and can do a simple parameter
query to find all records who have a specific criteria in
a specific field column but I would like to expand this
concept. Is there a way to easily "request" the field
name (like a parameter query) when a report is run or a
query is run and have the database look for that field and
then look for the criteria? Example: There are 5 fields
A, B, C, D, E. They are all yes/no fields. I would like
to be prompted as to which field I want to look in and
then have a quick way to get all of the records who have a
yes under that column? Can the query prompt me as to what
field I want to look in? Say, "Enter field". I would
enter C. The query would then look in field C and report
back to me the yes's.

With the 25-30 fields I have in my database, setting up 25-
30 queries and then the corresponding reports will take a
long time and I was trying to find an easier way.
  #2  
Old June 11th, 2004, 02:37 PM
Jeff Boyce
external usenet poster
 
Posts: n/a
Default querrying for a specific field

Bill

Your description makes it sound like you are using a spreadsheet (multiple,
repeating Y/N columns). This is not an efficient way to structure your
tables in Access, and makes certain tasks quite difficult. You may wish to
review the topic of normalization, which will, in turn, make using Access'
strengths and tools much easier.

For example, instead of multiple fields, each of which represents a Y/N
answer, you could create a table that holds a minimum of three fields. Each
row would need a way to identify who answered, what (question) was answered,
and what the answer was. One example would be something like:

trelResponse
AnswererID
QuestionID
Answer

This will give you much greater flexibility in querying and building
reports.

--
Good luck

Jeff Boyce
Access MVP

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:14 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.