Solved

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

Posted on 2011-09-21
9
218 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

734 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