Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 23rd, 2005, 02:11 AM
Sophie Sophie is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 4 Sophie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 m 44 sec
Reputation Power: 0
DCOUNT based on a query

Hi,

I'm new to Access, so please excuse my simple question.

I need to make a summary report of a group of records from a table. I first created a summary query that selected the group (criteria at the field CID=a value input by the user). The query includes 'Avg's of many fields. But beside averages, I want to include the % frequency of the occurrence of "5" in the field "Grade". In the control of my report that based on this query, I set the expression: dcount("Grade","My Query","Grade=5"), that gives me an "#error" on the report. I tried putting the dcount expression in the query itself ("Grade","My Table","Grade=5") but that count the whole table, not my selection in the query.

Any advice is appreciated.

Reply With Quote
  #2  
Old September 23rd, 2005, 05:09 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 4
Is your control placed in the footer of your report?

The expression DCount("[Grade]","MyQuery","[Grade]=5") should work.

lwells

Reply With Quote
  #3  
Old September 24th, 2005, 10:07 AM
Sophie Sophie is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 4 Sophie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 m 44 sec
Reputation Power: 0
No, I put in the detail section. I'll try that. In fact, what I try to obtain is a report like this:

----------------------------------------
For Class A
Average Grade: 4.5
Grade=5: 20%
----------------------------------------

I used a query to select Class A, then use Avg to get the average of Grade in the same query. I guess I would have to use a separate query to obtain the "Grade=5" count and somehow put it in a footer section?



Quote:
Originally Posted by lwells
Is your control placed in the footer of your report?

The expression DCount("[Grade]","MyQuery","[Grade]=5") should work.

lwells

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > DCOUNT based on a query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway