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  

query in access 2007 pulls yes only answers



 
 
Thread Tools Display Modes
  #1  
Old December 24th, 2009, 01:18 PM posted to microsoft.public.access.queries
Kim T
external usenet poster
 
Posts: 24
Default query in access 2007 pulls yes only answers

I've got a form that has Y/N questions I want to make a query that only pulls
the yes answers then turn that into a report need help please.
  #2  
Old December 24th, 2009, 02:06 PM posted to microsoft.public.access.queries
Tom van Stiphout[_2_]
external usenet poster
 
Posts: 1,653
Default query in access 2007 pulls yes only answers

On Thu, 24 Dec 2009 05:18:06 -0800, Kim T
wrote:

Create a new query. Select your fields in the grid. In the column for
your Y/N field in the criteria line type "Yes".

-Tom.
Microsoft Access MVP


I've got a form that has Y/N questions I want to make a query that only pulls
the yes answers then turn that into a report need help please.

  #3  
Old December 24th, 2009, 02:46 PM posted to microsoft.public.access.queries
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default query in access 2007 pulls yes only answers

You first need to find the table that's used to store the data that you see
in the form.

Open up that table and look at the columns.
-- Is there only one Yes/No column or are there a bunch of them?
-- In the table design, are these actual Yes/No data types or text fields
with "Yes" or "No" in them.

Next you need to know exactly what you want on the report. Assuming that
they are Yes/No data types AND there are many Yes/No columns, what do you
want? For example:

Name Blue Red
Tim Yes No
Jim No Yes
Slim Yes Yes
Ron No No

From the above would you want to see everything from everyone but Ron, or
only the Yes answers something like:

Tim Blue Yes
Jim Red Yes
Slim Blue Yes
Slim Red Yes

The table and field names would also help us help you.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

"Kim T" wrote:

I've got a form that has Y/N questions I want to make a query that only pulls
the yes answers then turn that into a report need help please.

  #4  
Old December 24th, 2009, 03:06 PM posted to microsoft.public.access.queries
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default query in access 2007 pulls yes only answers

Hi Tom,

If it's an actual Yes/No data type, you don't want the quotation marks.
You'll get a data type mismatch error. Actually -1 works best for Yes and 0
for No.

I'm also thinking that the problem may be with multiple Yes/No fields in the
table. Therefore all the questions in my other answer.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Tom van Stiphout" wrote:

On Thu, 24 Dec 2009 05:18:06 -0800, Kim T
wrote:

Create a new query. Select your fields in the grid. In the column for
your Y/N field in the criteria line type "Yes".

-Tom.
Microsoft Access MVP


I've got a form that has Y/N questions I want to make a query that only pulls
the yes answers then turn that into a report need help please.

.

  #5  
Old December 24th, 2009, 03:41 PM posted to microsoft.public.access.queries
Kim T
external usenet poster
 
Posts: 24
Default query in access 2007 pulls yes only answers

I've have 1 table with 34 questions. each question has data type being Yes/No

"Jerry Whittle" wrote:

You first need to find the table that's used to store the data that you see
in the form.

Open up that table and look at the columns.
-- Is there only one Yes/No column or are there a bunch of them?
-- In the table design, are these actual Yes/No data types or text fields
with "Yes" or "No" in them.

Next you need to know exactly what you want on the report. Assuming that
they are Yes/No data types AND there are many Yes/No columns, what do you
want? For example:

Name Blue Red
Tim Yes No
Jim No Yes
Slim Yes Yes
Ron No No

From the above would you want to see everything from everyone but Ron, or
only the Yes answers something like:

Tim Blue Yes
Jim Red Yes
Slim Blue Yes
Slim Red Yes

The table and field names would also help us help you.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

"Kim T" wrote:

I've got a form that has Y/N questions I want to make a query that only pulls
the yes answers then turn that into a report need help please.

  #6  
Old December 24th, 2009, 04:05 PM posted to microsoft.public.access.queries
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default query in access 2007 pulls yes only answers

(My apologies if this gets posted more than once. Something strange happened
during the first attempts.)

Sorry to hear that. The proper table structure would be down and not across.
It would look something like:

Name Question Answer
Jim Blue No
Jim Red Yes
-- and so on. Then a simple query something like this would do the job.

SELECT Name, Question, Answer
FROM YourTable
WHERE Answer = Yes ;

To deal with your existing table structure and depending on how you want to
see the data, it will probably take 34 queries joined by UNION ALL. Using my
little table example below, the SQL statement would look like:

Select Name, "Blue" as TheQuestion, "YES" as TheAnswer
FROM YourTableName
WHERE Blue = Yes
UNION ALL
Select Name, "Red" as TheQuestion, "YES" as TheAnswer
FROM YourTableName
WHERE RED = Yes
UNION ALL
-- for all 34 questions.

The "Blue" and "Red" would put those words in the records returned. The
"YES" does the same although you might not need it as you are only looking
for Yes answers.

Once you get it to run, you could create a report based on the above query.

--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Kim T" wrote:

I've have 1 table with 34 questions. each question has data type being Yes/No

"Jerry Whittle" wrote:

You first need to find the table that's used to store the data that you see
in the form.

Open up that table and look at the columns.
-- Is there only one Yes/No column or are there a bunch of them?
-- In the table design, are these actual Yes/No data types or text fields
with "Yes" or "No" in them.

Next you need to know exactly what you want on the report. Assuming that
they are Yes/No data types AND there are many Yes/No columns, what do you
want? For example:

Name Blue Red
Tim Yes No
Jim No Yes
Slim Yes Yes
Ron No No

From the above would you want to see everything from everyone but Ron, or
only the Yes answers something like:

Tim Blue Yes
Jim Red Yes
Slim Blue Yes
Slim Red Yes

The table and field names would also help us help you.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

"Kim T" wrote:

I've got a form that has Y/N questions I want to make a query that only pulls
the yes answers then turn that into a report need help please.

  #7  
Old December 24th, 2009, 04:37 PM posted to microsoft.public.access.queries
Kim T
external usenet poster
 
Posts: 24
Default query in access 2007 pulls yes only answers

thankyou I will try this on Tuesday getting ready to leave for the holiday.
will you be around tuesday if I need help?

"Jerry Whittle" wrote:

(My apologies if this gets posted more than once. Something strange happened
during the first attempts.)

Sorry to hear that. The proper table structure would be down and not across.
It would look something like:

Name Question Answer
Jim Blue No
Jim Red Yes
-- and so on. Then a simple query something like this would do the job.

SELECT Name, Question, Answer
FROM YourTable
WHERE Answer = Yes ;

To deal with your existing table structure and depending on how you want to
see the data, it will probably take 34 queries joined by UNION ALL. Using my
little table example below, the SQL statement would look like:

Select Name, "Blue" as TheQuestion, "YES" as TheAnswer
FROM YourTableName
WHERE Blue = Yes
UNION ALL
Select Name, "Red" as TheQuestion, "YES" as TheAnswer
FROM YourTableName
WHERE RED = Yes
UNION ALL
-- for all 34 questions.

The "Blue" and "Red" would put those words in the records returned. The
"YES" does the same although you might not need it as you are only looking
for Yes answers.

Once you get it to run, you could create a report based on the above query.

--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Kim T" wrote:

I've have 1 table with 34 questions. each question has data type being Yes/No

"Jerry Whittle" wrote:

You first need to find the table that's used to store the data that you see
in the form.

Open up that table and look at the columns.
-- Is there only one Yes/No column or are there a bunch of them?
-- In the table design, are these actual Yes/No data types or text fields
with "Yes" or "No" in them.

Next you need to know exactly what you want on the report. Assuming that
they are Yes/No data types AND there are many Yes/No columns, what do you
want? For example:

Name Blue Red
Tim Yes No
Jim No Yes
Slim Yes Yes
Ron No No

From the above would you want to see everything from everyone but Ron, or
only the Yes answers something like:

Tim Blue Yes
Jim Red Yes
Slim Blue Yes
Slim Red Yes

The table and field names would also help us help you.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

"Kim T" wrote:

I've got a form that has Y/N questions I want to make a query that only pulls
the yes answers then turn that into a report need help please.

  #8  
Old December 24th, 2009, 04:56 PM posted to microsoft.public.access.queries
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default query in access 2007 pulls yes only answers

I hope so! ;-)
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Kim T" wrote:

thankyou I will try this on Tuesday getting ready to leave for the holiday.
will you be around tuesday if I need help?

"Jerry Whittle" wrote:

(My apologies if this gets posted more than once. Something strange happened
during the first attempts.)

Sorry to hear that. The proper table structure would be down and not across.
It would look something like:

Name Question Answer
Jim Blue No
Jim Red Yes
-- and so on. Then a simple query something like this would do the job.

SELECT Name, Question, Answer
FROM YourTable
WHERE Answer = Yes ;

To deal with your existing table structure and depending on how you want to
see the data, it will probably take 34 queries joined by UNION ALL. Using my
little table example below, the SQL statement would look like:

Select Name, "Blue" as TheQuestion, "YES" as TheAnswer
FROM YourTableName
WHERE Blue = Yes
UNION ALL
Select Name, "Red" as TheQuestion, "YES" as TheAnswer
FROM YourTableName
WHERE RED = Yes
UNION ALL
-- for all 34 questions.

The "Blue" and "Red" would put those words in the records returned. The
"YES" does the same although you might not need it as you are only looking
for Yes answers.

Once you get it to run, you could create a report based on the above query.

--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Kim T" wrote:

I've have 1 table with 34 questions. each question has data type being Yes/No

"Jerry Whittle" wrote:

You first need to find the table that's used to store the data that you see
in the form.

Open up that table and look at the columns.
-- Is there only one Yes/No column or are there a bunch of them?
-- In the table design, are these actual Yes/No data types or text fields
with "Yes" or "No" in them.

Next you need to know exactly what you want on the report. Assuming that
they are Yes/No data types AND there are many Yes/No columns, what do you
want? For example:

Name Blue Red
Tim Yes No
Jim No Yes
Slim Yes Yes
Ron No No

From the above would you want to see everything from everyone but Ron, or
only the Yes answers something like:

Tim Blue Yes
Jim Red Yes
Slim Blue Yes
Slim Red Yes

The table and field names would also help us help you.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

"Kim T" wrote:

I've got a form that has Y/N questions I want to make a query that only pulls
the yes answers then turn that into a report need help please.

  #9  
Old December 29th, 2009, 06:36 PM posted to microsoft.public.access.queries
Kim T
external usenet poster
 
Posts: 24
Default query in access 2007 pulls yes only answers

should I make three tables then:
Patient (Name, SS#, Date)
Question (list each)
Answer (make this a Yes/No or text with yes/no)
Relate all 3 together by SS# ?


"Jerry Whittle" wrote:

I hope so! ;-)
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Kim T" wrote:

thankyou I will try this on Tuesday getting ready to leave for the holiday.
will you be around tuesday if I need help?

"Jerry Whittle" wrote:

(My apologies if this gets posted more than once. Something strange happened
during the first attempts.)

Sorry to hear that. The proper table structure would be down and not across.
It would look something like:

Name Question Answer
Jim Blue No
Jim Red Yes
-- and so on. Then a simple query something like this would do the job.

SELECT Name, Question, Answer
FROM YourTable
WHERE Answer = Yes ;

To deal with your existing table structure and depending on how you want to
see the data, it will probably take 34 queries joined by UNION ALL. Using my
little table example below, the SQL statement would look like:

Select Name, "Blue" as TheQuestion, "YES" as TheAnswer
FROM YourTableName
WHERE Blue = Yes
UNION ALL
Select Name, "Red" as TheQuestion, "YES" as TheAnswer
FROM YourTableName
WHERE RED = Yes
UNION ALL
-- for all 34 questions.

The "Blue" and "Red" would put those words in the records returned. The
"YES" does the same although you might not need it as you are only looking
for Yes answers.

Once you get it to run, you could create a report based on the above query.

--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Kim T" wrote:

I've have 1 table with 34 questions. each question has data type being Yes/No

"Jerry Whittle" wrote:

You first need to find the table that's used to store the data that you see
in the form.

Open up that table and look at the columns.
-- Is there only one Yes/No column or are there a bunch of them?
-- In the table design, are these actual Yes/No data types or text fields
with "Yes" or "No" in them.

Next you need to know exactly what you want on the report. Assuming that
they are Yes/No data types AND there are many Yes/No columns, what do you
want? For example:

Name Blue Red
Tim Yes No
Jim No Yes
Slim Yes Yes
Ron No No

From the above would you want to see everything from everyone but Ron, or
only the Yes answers something like:

Tim Blue Yes
Jim Red Yes
Slim Blue Yes
Slim Red Yes

The table and field names would also help us help you.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

"Kim T" wrote:

I've got a form that has Y/N questions I want to make a query that only pulls
the yes answers then turn that into a report need help please.

  #10  
Old December 30th, 2009, 05:05 PM posted to microsoft.public.access.queries
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default query in access 2007 pulls yes only answers

You might want to look at Duane Hookom's At Your Survey database example. It
can be found at:

http://www.rogersaccesslibrary.com/f...osts.asp?TID=3
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Kim T" wrote:

should I make three tables then:
Patient (Name, SS#, Date)
Question (list each)
Answer (make this a Yes/No or text with yes/no)
Relate all 3 together by SS# ?


"Jerry Whittle" wrote:

I hope so! ;-)
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Kim T" wrote:

thankyou I will try this on Tuesday getting ready to leave for the holiday.
will you be around tuesday if I need help?

"Jerry Whittle" wrote:

(My apologies if this gets posted more than once. Something strange happened
during the first attempts.)

Sorry to hear that. The proper table structure would be down and not across.
It would look something like:

Name Question Answer
Jim Blue No
Jim Red Yes
-- and so on. Then a simple query something like this would do the job.

SELECT Name, Question, Answer
FROM YourTable
WHERE Answer = Yes ;

To deal with your existing table structure and depending on how you want to
see the data, it will probably take 34 queries joined by UNION ALL. Using my
little table example below, the SQL statement would look like:

Select Name, "Blue" as TheQuestion, "YES" as TheAnswer
FROM YourTableName
WHERE Blue = Yes
UNION ALL
Select Name, "Red" as TheQuestion, "YES" as TheAnswer
FROM YourTableName
WHERE RED = Yes
UNION ALL
-- for all 34 questions.

The "Blue" and "Red" would put those words in the records returned. The
"YES" does the same although you might not need it as you are only looking
for Yes answers.

Once you get it to run, you could create a report based on the above query.

--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Kim T" wrote:

I've have 1 table with 34 questions. each question has data type being Yes/No

"Jerry Whittle" wrote:

You first need to find the table that's used to store the data that you see
in the form.

Open up that table and look at the columns.
-- Is there only one Yes/No column or are there a bunch of them?
-- In the table design, are these actual Yes/No data types or text fields
with "Yes" or "No" in them.

Next you need to know exactly what you want on the report. Assuming that
they are Yes/No data types AND there are many Yes/No columns, what do you
want? For example:

Name Blue Red
Tim Yes No
Jim No Yes
Slim Yes Yes
Ron No No

From the above would you want to see everything from everyone but Ron, or
only the Yes answers something like:

Tim Blue Yes
Jim Red Yes
Slim Blue Yes
Slim Red Yes

The table and field names would also help us help you.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

"Kim T" wrote:

I've got a form that has Y/N questions I want to make a query that only pulls
the yes answers then turn that into a report need help please.

 




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 09:03 PM.


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