Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dcount in Queried report

Status
Not open for further replies.

ranebow

Programmer
Mar 8, 2003
110
US
I'm trying to create a report to count females/males in classes in a specific semester. I've created a query to select the semester I want. When I run a report over the queried file I get total females/males of the whole file. I accidently ran the DCOUNT on the whole file. But I've been told that I can't run DCOUNT on an on-the-fly queried file. How do I get around this?
 
Hi,

In your report, there will be a recordsource which will be the name of a stored query or an SQL statement.

To bring in a total, using the Count (*) as total as one column, and then Group By on other fields, eg

Select Semester, Student, Gender, Count (*) As Total
From Table
Group By Semester, Student, Gender

By the way, there is no reason why you can't use the DCount function in a query or on a report, because calling a function from a query will slow it down considerably, but using the aggregate functions (such as Count) are a lot faster.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top