YES and NO

G

Guest

Me again,
Ok....my final dilema or question is....how do I tell access to count only
the Yes's....for example..on the form i created someone will check yes if
they complied with a date......so I want to run a query that will give me all
the Yes's and not all the records....help please.....thanks.....
 
R

raskew via AccessMonster.com

True (Yes) = -1, False(No) = 0, so absolute (ABS) of the sum of the fields
would = the count of True responses.

Bob
 
G

Guest

in your query set the criteria for the yes/no field to true (was checked yes
by the user). this will on return those records marked yes. then simply
count them...

Daniel P
 
G

Guest

Hi

In the crieria row of the query put this

-1 to get all the ticks

and

0 to get all the non tick

Or create a totals query and group by Count on the column and this will give
you a count of each type

On a form - add a unbound text box in the footer and use something like

=Count(IIf([FieldName]= -1,[FieldName]))

Hope this helps
 
G

Guest

WOW....seems detailed....and since im a novice...i like it...i will give it a
try...thanks!!

Wayne-I-M said:
Hi

In the crieria row of the query put this

-1 to get all the ticks

and

0 to get all the non tick

Or create a totals query and group by Count on the column and this will give
you a count of each type

On a form - add a unbound text box in the footer and use something like

=Count(IIf([FieldName]= -1,[FieldName]))

Hope this helps



--
Wayne
Manchester, England.



Ransom said:
Me again,
Ok....my final dilema or question is....how do I tell access to count only
the Yes's....for example..on the form i created someone will check yes if
they complied with a date......so I want to run a query that will give me all
the Yes's and not all the records....help please.....thanks.....
 
G

Guest

=Count(Abs[FieldName]))

Wayne-I-M said:
Hi

In the crieria row of the query put this

-1 to get all the ticks

and

0 to get all the non tick

Or create a totals query and group by Count on the column and this will
give
you a count of each type

On a form - add a unbound text box in the footer and use something like

=Count(IIf([FieldName]= -1,[FieldName]))

Hope this helps



--
Wayne
Manchester, England.



Ransom said:
Me again,
Ok....my final dilema or question is....how do I tell access to count
only
the Yes's....for example..on the form i created someone will check yes if
they complied with a date......so I want to run a query that will give me
all
the Yes's and not all the records....help please.....thanks.....
 
D

Dirk Goldgar

Wayne-I-M said:
Are you sure ?

Yes, quite sure. Count(Abs([FieldName])) will return the number of
records for which [FieldName] is not Null, which for a Jet boolean field
is all of them. But Sum(Abs([FieldName])) will return the number of
records for which [FieldName] = -1 (or 1, if you're using some other
database engine that stores boolean fields as 1, not -1).
 
D

Douglas J. Steele

Yes.

Because it's a Boolean field, its values will be either -1 (for True) or 0
(for False).

Using Abs means the values will be either 1 (for True) or 0 (for False)

Therefore, to find out how many True you have, you sum them.

Count doesn't care what the value is (as long as it isn't Null).

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Wayne-I-M said:
Not Count() -- Sum()

Are you sure ?


--
Wayne
Manchester, England.



Dirk Goldgar said:
Vladimír Cvajniga said:
=Count(Abs[FieldName]))

Not Count() -- Sum()

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
G

Guest

I just tested it and you are correct

I would still use =Count(IIf(.......etc etc etc



--
Wayne
Manchester, England.



Dirk Goldgar said:
Wayne-I-M said:
Are you sure ?

Yes, quite sure. Count(Abs([FieldName])) will return the number of
records for which [FieldName] is not Null, which for a Jet boolean field
is all of them. But Sum(Abs([FieldName])) will return the number of
records for which [FieldName] = -1 (or 1, if you're using some other
database engine that stores boolean fields as 1, not -1).

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
G

Guest

Abs should be much faster...

Wayne-I-M said:
I just tested it and you are correct

I would still use =Count(IIf(.......etc etc etc



--
Wayne
Manchester, England.



Dirk Goldgar said:
Wayne-I-M said:
Not Count() -- Sum()

Are you sure ?

Yes, quite sure. Count(Abs([FieldName])) will return the number of
records for which [FieldName] is not Null, which for a Jet boolean field
is all of them. But Sum(Abs([FieldName])) will return the number of
records for which [FieldName] = -1 (or 1, if you're using some other
database engine that stores boolean fields as 1, not -1).

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
G

Guest

Abs should be much faster...

There was a young bull and an old bull in a field. The young bull said to
the old bull lets run down the hill as fast as we can so we can charge into
the that field full of cows and have a good time with as many as we can
before we are exhausted. The old bull replied lets walk down the hill slowly
and take a long as we like in the field of cows.

???

--
Wayne
Manchester, England.



Vladimír Cvajniga said:
Abs should be much faster...

Wayne-I-M said:
I just tested it and you are correct

I would still use =Count(IIf(.......etc etc etc



--
Wayne
Manchester, England.



Dirk Goldgar said:
Not Count() -- Sum()

Are you sure ?

Yes, quite sure. Count(Abs([FieldName])) will return the number of
records for which [FieldName] is not Null, which for a Jet boolean field
is all of them. But Sum(Abs([FieldName])) will return the number of
records for which [FieldName] = -1 (or 1, if you're using some other
database engine that stores boolean fields as 1, not -1).

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
G

Guest

:-D

With huge database you should spend ages "in the field of cows". ;-)

Wayne-I-M said:
Abs should be much faster...

There was a young bull and an old bull in a field. The young bull said to
the old bull lets run down the hill as fast as we can so we can charge
into
the that field full of cows and have a good time with as many as we can
before we are exhausted. The old bull replied lets walk down the hill
slowly
and take a long as we like in the field of cows.

???

--
Wayne
Manchester, England.



Vladimír Cvajniga said:
Abs should be much faster...

"Wayne-I-M" <[email protected]> píše v diskusním
příspěvku
I just tested it and you are correct

I would still use =Count(IIf(.......etc etc etc



--
Wayne
Manchester, England.



:

Not Count() -- Sum()

Are you sure ?

Yes, quite sure. Count(Abs([FieldName])) will return the number of
records for which [FieldName] is not Null, which for a Jet boolean
field
is all of them. But Sum(Abs([FieldName])) will return the number of
records for which [FieldName] = -1 (or 1, if you're using some other
database engine that stores boolean fields as 1, not -1).

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
G

Guest

--
Wayne
Manchester, England.
With huge database you should spend ages "in the field of cows". ;-)

No - not going to answer that ;-) there is some one looking over my shoulder
ha ha ha - she has informed me that I have no opinion on this mater - or I
have to cook my own dinner ??




Vladimír Cvajniga said:
:-D

With huge database you should spend ages "in the field of cows". ;-)

Wayne-I-M said:
Abs should be much faster...

There was a young bull and an old bull in a field. The young bull said to
the old bull lets run down the hill as fast as we can so we can charge
into
the that field full of cows and have a good time with as many as we can
before we are exhausted. The old bull replied lets walk down the hill
slowly
and take a long as we like in the field of cows.

???

--
Wayne
Manchester, England.



Vladimír Cvajniga said:
Abs should be much faster...

"Wayne-I-M" <[email protected]> píše v diskusním
příspěvku
I just tested it and you are correct

I would still use =Count(IIf(.......etc etc etc



--
Wayne
Manchester, England.



:

Not Count() -- Sum()

Are you sure ?

Yes, quite sure. Count(Abs([FieldName])) will return the number of
records for which [FieldName] is not Null, which for a Jet boolean
field
is all of them. But Sum(Abs([FieldName])) will return the number of
records for which [FieldName] = -1 (or 1, if you're using some other
database engine that stores boolean fields as 1, not -1).

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
G

Guest

:-D

Do your best, Wayne!

Vlado

Wayne-I-M said:
--
Wayne
Manchester, England.
With huge database you should spend ages "in the field of cows". ;-)

No - not going to answer that ;-) there is some one looking over my
shoulder
ha ha ha - she has informed me that I have no opinion on this mater - or I
have to cook my own dinner ??




Vladimír Cvajniga said:
:-D

With huge database you should spend ages "in the field of cows". ;-)

"Wayne-I-M" <[email protected]> píše v diskusním
příspěvku
Abs should be much faster...

There was a young bull and an old bull in a field. The young bull said
to
the old bull lets run down the hill as fast as we can so we can charge
into
the that field full of cows and have a good time with as many as we can
before we are exhausted. The old bull replied lets walk down the hill
slowly
and take a long as we like in the field of cows.

???

--
Wayne
Manchester, England.



:

Abs should be much faster...

"Wayne-I-M" <[email protected]> píše v diskusním
příspěvku
I just tested it and you are correct

I would still use =Count(IIf(.......etc etc etc



--
Wayne
Manchester, England.



:

Not Count() -- Sum()

Are you sure ?

Yes, quite sure. Count(Abs([FieldName])) will return the number of
records for which [FieldName] is not Null, which for a Jet boolean
field
is all of them. But Sum(Abs([FieldName])) will return the number
of
records for which [FieldName] = -1 (or 1, if you're using some
other
database engine that stores boolean fields as 1, not -1).

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
G

Guest

you GUYS.....:D........thanks......

Wayne-I-M said:
--
Wayne
Manchester, England.
With huge database you should spend ages "in the field of cows". ;-)

No - not going to answer that ;-) there is some one looking over my shoulder
ha ha ha - she has informed me that I have no opinion on this mater - or I
have to cook my own dinner ??




Vladimír Cvajniga said:
:-D

With huge database you should spend ages "in the field of cows". ;-)

Wayne-I-M said:
Abs should be much faster...

There was a young bull and an old bull in a field. The young bull said to
the old bull lets run down the hill as fast as we can so we can charge
into
the that field full of cows and have a good time with as many as we can
before we are exhausted. The old bull replied lets walk down the hill
slowly
and take a long as we like in the field of cows.

???

--
Wayne
Manchester, England.



:

Abs should be much faster...

"Wayne-I-M" <[email protected]> píše v diskusním
příspěvku
I just tested it and you are correct

I would still use =Count(IIf(.......etc etc etc



--
Wayne
Manchester, England.



:

Not Count() -- Sum()

Are you sure ?

Yes, quite sure. Count(Abs([FieldName])) will return the number of
records for which [FieldName] is not Null, which for a Jet boolean
field
is all of them. But Sum(Abs([FieldName])) will return the number of
records for which [FieldName] = -1 (or 1, if you're using some other
database engine that stores boolean fields as 1, not -1).

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
J

John W. Vinson

No - not going to answer that ;-) there is some one looking over my shoulder
ha ha ha - she has informed me that I have no opinion on this mater - or I
have to cook my own dinner ??

Oh well, get out the Kraft boxed macaroni and cheese then... <bg>

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top