Avatar of 25112
25112
 asked on

control to hold a single value in a report. (access 2002)

please see attached..
what will be the right control to place where the marked green box is.

the query in the 'REPORT' whose property is highlighted is as below (simplified, leaving out the complex conditions)
SELECT field1, Field2, Field3,Field4
FROM Book_Table
WHERE Condition1 AND condition2
ORDER BY Field2 DESC;

The new field to introduce below the above 'REPORT' control, would be of the below format:
SELECT avg(Field3)
FROM Book_Table
WHERE Condition1 AND condition2
heaader.png
Microsoft Access

Avatar of undefined
Last Comment
25112

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
chaau

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
PatHartman

what will be the right control to place where the marked green box is.
Usage of controls is not arbitrary.  What do you want to see in the control?  It looks to me like you probably want another subreport.
25112

ASKER
>>What do you want to see in the control?
The new one will be an average.. so a single value.
the existing report (3 next to each other ) is a 3 column list..

if it is a single value, do you recommend subreport for any value/reason?
SOLUTION
PatHartman

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
25112

ASKER
the report source is a QUERY with
SELECT field1, Field2, Field3,Field4
 FROM Book_Table
 WHERE Condition1 AND condition2
 ORDER BY Field2 DESC;

for
SELECT avg(Field3)
 FROM Book_Table
 WHERE Condition1 AND condition2
in txt box, you mentioned: DAvg instead of avg. is that for specific reason?

so, will be it format like:
DAvg("Field3", "Book_Table", "Column1=1 AND Column2=2")
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
PatHartman

Is that a question?
25112

ASKER
thank you for confirming