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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calculate the field from other fields

Status
Not open for further replies.

maswien

Technical User
Sep 24, 2003
1,286
CA

I wonder if it's possible to populate a field from calculating other fields on the report? For example, on a report there are following fields:

Code:
             Scores
             =======

 homework   midterm   finalterm     avg (calculated)
 ---------  --------  ----------    ----

 80         90        100           90
 70         50        60            60
 ... ...

The avg is calculated from the three fields and it's generated in the run time of the report is opened, for some reason I don't want the avg comes from the same query of other three fields, I must get it from calculating the other three fields, is this possible at all?

Thanks!
 
What do you want to do with the average? It sounds like you want to update a value back in your table but that couldn't be right.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 

Sorry for the confuse, no I don't want update the table, I just want a calculated field on the report. For example, when I create the report from a query, all I have are three columns: homework, midterm, finalterm. I don't want change the query, I want add another column on the report , the value of this column is calculated from the other three, does this help?
 
You should be able to use
=(homework+midterm+finalterm)/3
This assumes there will be values in all three fields.

Do you really have separate fields for grades? If so, you should consider normalizing your table structure.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 

Thanks dhookom, really helpful comment!

It's just an simplified example, I'm writing a fairly complicated report, when your boss want everything in one report and the report should show well and that complicate things.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top