Running a query that totals my Columns

J

Jon M.

I am trying to run a query that will give me a total of the given fields in a
given time period. For example, my form consists of several check boxes,
they are represented by a 1 if checked and a 0 if unchecked in my table. How
can make my query so for the month of January I can see the sum of how many
times each box was checked? I have the query set to show me the specific
months and subjects for each month but I can't figure out how to get the
total for the month in there. Does that make sense? Should I even be doing
a query for this, or is this a report function I'm looking for? I would
appreciate any help I can get on this.
 
J

John Spencer

Use a totals query.

SELECT MonthName
, Sum(CheckboxA) as CountA
, Sum(CheckboxB) as CountB
, Sum(CheckboxC) as CountC
FROM YourTable
GROUP BY MonthName

In query design view
-- Select the checkbox fields
-- SELECT View: Totals from the menu
-- Change GROUP By to SUM under all those field
-- Select you datefield
---- Set Group By to Where
---- Enter a date range in the criteriia under your date field.
--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

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