So you want the count for each column when that column has a value of 1 or
more?
A query such as this should work for you:
SELECT (Abs(SUM([aoc]>0 and SchoolID=4))) AS aocCount,
(Abs(SUM([boc]>0 and SchoolID=4))) AS bocCount,
(Abs(SUM([coc]>0 and SchoolID=4))) AS cocCount,
(Abs(SUM([doc]>0 and SchoolID=4))) AS docCount,
(Abs(SUM([eoc]>0 and SchoolID=4))) AS eocCount,
(Abs(SUM([foc]>0 and SchoolID=4))) AS focCount,
(Abs(SUM([goc]>0 and SchoolID=4))) AS gocCount,
(Abs(SUM([hoc]>0 and SchoolID=4))) AS hocCount
FROM TableName;
Then use this query as the recordsource for your report.
--
Ken Snell
<MS ACCESS MVP>
cwr said:
ok...i have 8 columns....aoc, boc, coc, doc thru hoc
there is also column with school id
they want of count of how many entries have a number 1 or greater
so i made 8 queries
when in deisgn view for query, used query--> sql specific--> data
definition
and
put
SELECT count(aoc)
when i run the query i get correct count..displayed as datasheet view with
a
column named Expr2
(if i go to design view of query first column has Field: Expr2:Count(aoc)
In design view for report, have created textbox, rclick on properties,
have
Control Source as Expr2 in Data tab.
When i look at properties for Report (chose Report in dropdown of
properties
box), i have my query name as RecordSource. But i need to add 8 other
text
boxes to report, each with it's own query. Cannot figure out how to tie
all
8 queries to one report.
Sorry for this post, but have found no one who knows access. I used Data
Definition to write out my query. Come from heavy SQL background, but
struggling with Access..