Solved

Is it possible to sum from multiple fields in calcutalted Filed?

Posted on 2011-09-21
9
215 Views
Last Modified: 2012-05-12
Is it possible to sum from multiple fields in calcutalted Filed?
I have a table with square value (m2). See figure:

-------------------------------------------------- -----------------------------
PropertyID propertyName m2
-------------------------------------------------- -----------------------------
1           castle           200
2           tent              120
3           castle          310
4           yard             540
-------------------------------------------------- -----------------------------

I want to sum castle (200 + 310 = 510) in a Calculated Field. Is it possible or do I make a query for it. In that case, I am grateful for an example.

Thanks in advance!

best regards
0
Comment
Question by:EuroCasaCar
  • 4
  • 4
9 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36573757
you can that by using a total query

select  propertyName,Sum(m2)
from tablex
group by propertyName
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 36573797
or you can use a crosstab query

TRANSFORM Sum(TableX.m2) AS SumOfm2
SELECT TableX.propertyName
FROM TableX
GROUP BY TableX.propertyName
PIVOT TableX.propertyName;
0
 
LVL 31

Expert Comment

by:Helen_Feddema
ID: 36574142
This can also be done with a PivotTable.  Where do you want to see the results of this calculation?  A form, a report, a chart?
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

Author Comment

by:EuroCasaCar
ID: 36574987
@Helen_Feddema

Thank you. I want to store the value in a table. The same table (tablex).


0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36575007
EuroCasaCar,

it is not advisable to store calculated data in the table. you can always derived the accurate information using a query.
0
 

Author Comment

by:EuroCasaCar
ID: 36575079
@capricorn1

Thank you for your answers.
I know but in this case we need it.

0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36575113
ok, post sample values with field names that show the information with the calculated value after you run an update query or make table query.

0
 

Author Comment

by:EuroCasaCar
ID: 36579181
Later today I will post a sample.
Thank you for your help.
0
 

Author Comment

by:EuroCasaCar
ID: 36580768

I have a table with a number of fields. Among other fields, "square", "TotalSale2011" and "Rent2011".

I would by a new field (Calculated field) make a calculation:
sum (TotalSales2011) / square meter.

So get the sum of TotalSales2011 (all items) divided by the square of the unique item. Is it possible to do so via Calculated Field.

Thanks in advance!
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question