COUNT Function

F

FC

The field is " Is this your first Visit?" and they have the option from a
dropdown to select either " Yes" OR "No". So for eg. for this question I need
to know how many said yes and how many said no, there are about 400(records)
people surveyed.
Thanks
 
K

KARL DEWEY

The Yes/No field is stored as -1 and 0 (zero).
You can Sum(Abs([YourYesNoField]) to count all the records that have -1.
 
F

FC

Thanks for the reply, but I need to have it show up in query in two clomns as
Count of Yes and Count of No respectively How do I do that?

KARL DEWEY said:
The Yes/No field is stored as -1 and 0 (zero).
You can Sum(Abs([YourYesNoField]) to count all the records that have -1.

FC said:
The field is " Is this your first Visit?" and they have the option from a
dropdown to select either " Yes" OR "No". So for eg. for this question I need
to know how many said yes and how many said no, there are about 400(records)
people surveyed.
Thanks
 
D

Duane Hookom

You actually have a field named " Is this your first Visit?" What is the
data type?
Karl's answer might work as a count of yes if the field is a yes/no field.
You should be able to figure out the count of no based on his response.

--
Duane Hookom
MS Access MVP


FC said:
Thanks for the reply, but I need to have it show up in query in two clomns
as
Count of Yes and Count of No respectively How do I do that?

KARL DEWEY said:
The Yes/No field is stored as -1 and 0 (zero).
You can Sum(Abs([YourYesNoField]) to count all the records that
have -1.

FC said:
The field is " Is this your first Visit?" and they have the option from
a
dropdown to select either " Yes" OR "No". So for eg. for this question
I need
to know how many said yes and how many said no, there are about
400(records)
people surveyed.
Thanks
 
F

FC

Yes That is the name of the field, the data type is 'text'. The person
surveyed sees a form with these questions against which is a dropdown box to
select the appropriate answer? Pls Help.

Duane Hookom said:
You actually have a field named " Is this your first Visit?" What is the
data type?
Karl's answer might work as a count of yes if the field is a yes/no field.
You should be able to figure out the count of no based on his response.

--
Duane Hookom
MS Access MVP


FC said:
Thanks for the reply, but I need to have it show up in query in two clomns
as
Count of Yes and Count of No respectively How do I do that?

KARL DEWEY said:
The Yes/No field is stored as -1 and 0 (zero).
You can Sum(Abs([YourYesNoField]) to count all the records that
have -1.

:

The field is " Is this your first Visit?" and they have the option from
a
dropdown to select either " Yes" OR "No". So for eg. for this question
I need
to know how many said yes and how many said no, there are about
400(records)
people surveyed.
Thanks
 
D

Duane Hookom

Create a column in your query:
Field: CountYes: Abs([Is this your first Visit?]="yes")
Total: Sum

In the future, consider the fact that users don't/shouldn't see field names
so you can name a field like "FirstVisit" rather than a long title with
spaces and punctuation.

--
Duane Hookom
MS Access MVP
--

FC said:
Yes That is the name of the field, the data type is 'text'. The person
surveyed sees a form with these questions against which is a dropdown box
to
select the appropriate answer? Pls Help.

Duane Hookom said:
You actually have a field named " Is this your first Visit?" What is the
data type?
Karl's answer might work as a count of yes if the field is a yes/no
field.
You should be able to figure out the count of no based on his response.

--
Duane Hookom
MS Access MVP


FC said:
Thanks for the reply, but I need to have it show up in query in two
clomns
as
Count of Yes and Count of No respectively How do I do that?

:

The Yes/No field is stored as -1 and 0 (zero).
You can Sum(Abs([YourYesNoField]) to count all the records that
have -1.

:

The field is " Is this your first Visit?" and they have the option
from
a
dropdown to select either " Yes" OR "No". So for eg. for this
question
I need
to know how many said yes and how many said no, there are about
400(records)
people surveyed.
Thanks
 
K

KARL DEWEY

I thought you had datatype of Yes/No.

FC what are you going to do if they somehow misspell any of the words? Have
you set a validation rule?

Duane Hookom said:
Create a column in your query:
Field: CountYes: Abs([Is this your first Visit?]="yes")
Total: Sum

In the future, consider the fact that users don't/shouldn't see field names
so you can name a field like "FirstVisit" rather than a long title with
spaces and punctuation.

--
Duane Hookom
MS Access MVP
--

FC said:
Yes That is the name of the field, the data type is 'text'. The person
surveyed sees a form with these questions against which is a dropdown box
to
select the appropriate answer? Pls Help.

Duane Hookom said:
You actually have a field named " Is this your first Visit?" What is the
data type?
Karl's answer might work as a count of yes if the field is a yes/no
field.
You should be able to figure out the count of no based on his response.

--
Duane Hookom
MS Access MVP


Thanks for the reply, but I need to have it show up in query in two
clomns
as
Count of Yes and Count of No respectively How do I do that?

:

The Yes/No field is stored as -1 and 0 (zero).
You can Sum(Abs([YourYesNoField]) to count all the records that
have -1.

:

The field is " Is this your first Visit?" and they have the option
from
a
dropdown to select either " Yes" OR "No". So for eg. for this
question
I need
to know how many said yes and how many said no, there are about
400(records)
people surveyed.
Thanks
 
D

Duane Hookom

I think FC used a "lookup field" or maybe a kinder, gentler combo box on a
form. This should provide the proper consistency. A yes/no field might have
been a better choice.

--
Duane Hookom
MS Access MVP


KARL DEWEY said:
I thought you had datatype of Yes/No.

FC what are you going to do if they somehow misspell any of the words?
Have
you set a validation rule?

Duane Hookom said:
Create a column in your query:
Field: CountYes: Abs([Is this your first Visit?]="yes")
Total: Sum

In the future, consider the fact that users don't/shouldn't see field
names
so you can name a field like "FirstVisit" rather than a long title with
spaces and punctuation.

--
Duane Hookom
MS Access MVP
--

FC said:
Yes That is the name of the field, the data type is 'text'. The person
surveyed sees a form with these questions against which is a dropdown
box
to
select the appropriate answer? Pls Help.

:

You actually have a field named " Is this your first Visit?" What is
the
data type?
Karl's answer might work as a count of yes if the field is a yes/no
field.
You should be able to figure out the count of no based on his
response.

--
Duane Hookom
MS Access MVP


Thanks for the reply, but I need to have it show up in query in two
clomns
as
Count of Yes and Count of No respectively How do I do that?

:

The Yes/No field is stored as -1 and 0 (zero).
You can Sum(Abs([YourYesNoField]) to count all the records that
have -1.

:

The field is " Is this your first Visit?" and they have the
option
from
a
dropdown to select either " Yes" OR "No". So for eg. for this
question
I need
to know how many said yes and how many said no, there are about
400(records)
people surveyed.
Thanks
 
F

FC

It's me again!
The SQL Statments worked, I open the query to look at the numbers when I
try to close the query I get a message:
"This action will reset the current code.
Do u want to stop the running code?"
If I say yes the same message comes up, if I say no the message goes away so
all in all I cannot close the query Please help!!!!!!
Thanks for all your help guys.

Duane Hookom said:
I think FC used a "lookup field" or maybe a kinder, gentler combo box on a
form. This should provide the proper consistency. A yes/no field might have
been a better choice.

--
Duane Hookom
MS Access MVP


KARL DEWEY said:
I thought you had datatype of Yes/No.

FC what are you going to do if they somehow misspell any of the words?
Have
you set a validation rule?

Duane Hookom said:
Create a column in your query:
Field: CountYes: Abs([Is this your first Visit?]="yes")
Total: Sum

In the future, consider the fact that users don't/shouldn't see field
names
so you can name a field like "FirstVisit" rather than a long title with
spaces and punctuation.

--
Duane Hookom
MS Access MVP
--

Yes That is the name of the field, the data type is 'text'. The person
surveyed sees a form with these questions against which is a dropdown
box
to
select the appropriate answer? Pls Help.

:

You actually have a field named " Is this your first Visit?" What is
the
data type?
Karl's answer might work as a count of yes if the field is a yes/no
field.
You should be able to figure out the count of no based on his
response.

--
Duane Hookom
MS Access MVP


Thanks for the reply, but I need to have it show up in query in two
clomns
as
Count of Yes and Count of No respectively How do I do that?

:

The Yes/No field is stored as -1 and 0 (zero).
You can Sum(Abs([YourYesNoField]) to count all the records that
have -1.

:

The field is " Is this your first Visit?" and they have the
option
from
a
dropdown to select either " Yes" OR "No". So for eg. for this
question
I need
to know how many said yes and how many said no, there are about
400(records)
people surveyed.
Thanks
 
D

Duane Hookom

If you can't save a query, view its SQL view and copy and paste the SQL into
NotePad. You can then attempt to compact your database. Later you can create
a new query and paste in the sql from NotePad.

--
Duane Hookom
MS Access MVP


FC said:
It's me again!
The SQL Statments worked, I open the query to look at the numbers when I
try to close the query I get a message:
"This action will reset the current code.
Do u want to stop the running code?"
If I say yes the same message comes up, if I say no the message goes away
so
all in all I cannot close the query Please help!!!!!!
Thanks for all your help guys.

Duane Hookom said:
I think FC used a "lookup field" or maybe a kinder, gentler combo box on
a
form. This should provide the proper consistency. A yes/no field might
have
been a better choice.

--
Duane Hookom
MS Access MVP


KARL DEWEY said:
I thought you had datatype of Yes/No.

FC what are you going to do if they somehow misspell any of the words?
Have
you set a validation rule?

:

Create a column in your query:
Field: CountYes: Abs([Is this your first Visit?]="yes")
Total: Sum

In the future, consider the fact that users don't/shouldn't see field
names
so you can name a field like "FirstVisit" rather than a long title
with
spaces and punctuation.

--
Duane Hookom
MS Access MVP
--

Yes That is the name of the field, the data type is 'text'. The
person
surveyed sees a form with these questions against which is a
dropdown
box
to
select the appropriate answer? Pls Help.

:

You actually have a field named " Is this your first Visit?" What
is
the
data type?
Karl's answer might work as a count of yes if the field is a yes/no
field.
You should be able to figure out the count of no based on his
response.

--
Duane Hookom
MS Access MVP


Thanks for the reply, but I need to have it show up in query in
two
clomns
as
Count of Yes and Count of No respectively How do I do that?

:

The Yes/No field is stored as -1 and 0 (zero).
You can Sum(Abs([YourYesNoField]) to count all the records
that
have -1.

:

The field is " Is this your first Visit?" and they have the
option
from
a
dropdown to select either " Yes" OR "No". So for eg. for this
question
I need
to know how many said yes and how many said no, there are
about
400(records)
people surveyed.
Thanks
 
Top