Re: Trouble summing yes/no checkbox fields in query
- From: "Michel Walsh" <vanderghast@VirusAreFunnierThanSpam>
- Date: Thu, 1 Mar 2007 16:45:23 -0500
Ha, I thought you wished to see the records where all the 6 fields were
checked.
SELECT ABS(SUM(ckField1)), ABS(SUM(ckField2)), ABS(SUM(ckField3)),
ABS(SUM(ckField4)), ABS(SUM(ckField5)), ABS(SUM(ckField6))
FROM myTable
will do what you want. Replace the ckFieldx fields with yours, same for
myTable. It is based on the fact the true (or yes) = -1 and false (or no) =
0. So, summing the values is the same as counting the true... ABS, the
absolute value, returns a positive value.
Hoping it may help,
Vanderghast, Access MVP
<katy.wortman@xxxxxxxxx> wrote in message
news:1172782625.157516.90580@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Mar 1, 3:30 pm, "Michel Walsh"
<vanderghast@VirusAreFunnierThanSpam> wrote:
You are using the graphical editor for a new query? If so, have the table
in
the top half, then, drag each of the 6 "check" fields, in the grid, one
at
a time, in the lower half of the editor. In the grid, of the editor, spot
the line criteria, add
<> false
for these columns that are your check fields you just dragged.
Drag the other fields, the ones you want to see, in the grid. And that's
all. Take a look in the data view.
Hoping it may help,
Vanderghast, Access MVP
Thanks Michel - but when I do this, I see a check boxes where I want
to see numbers. I would like the query to return the number of
records where each particular field is checked. Does this make sense?
Thanks again -
Katy
.
- Follow-Ups:
- Re: Trouble summing yes/no checkbox fields in query
- From: katy . wortman
- Re: Trouble summing yes/no checkbox fields in query
- References:
- Trouble summing yes/no checkbox fields in query
- From: katy . wortman
- Re: Trouble summing yes/no checkbox fields in query
- From: Michel Walsh
- Re: Trouble summing yes/no checkbox fields in query
- From: katy . wortman
- Re: Trouble summing yes/no checkbox fields in query
- From: Michel Walsh
- Re: Trouble summing yes/no checkbox fields in query
- From: katy . wortman
- Trouble summing yes/no checkbox fields in query
- Prev by Date: Re: Finding a text field in a field
- Next by Date: Re: problem with query
- Previous by thread: Re: Trouble summing yes/no checkbox fields in query
- Next by thread: Re: Trouble summing yes/no checkbox fields in query
- Index(es):
Relevant Pages
|