|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
Is your control placed in the footer of your report?
The expression DCount("[Grade]","MyQuery","[Grade]=5") should work. lwells |
|
#3
|
|||
|
|||
|
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:
|
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > DCOUNT based on a query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|