Solved

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

Posted on 2011-09-21
9
214 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 119

Expert Comment

by:Rey Obrero
Comment Utility
you can that by using a total query

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

Accepted Solution

by:
Rey Obrero earned 500 total points
Comment Utility
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
Comment Utility
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
 

Author Comment

by:EuroCasaCar
Comment Utility
@Helen_Feddema

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


0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
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
Comment Utility
@capricorn1

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

0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
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
Comment Utility
Later today I will post a sample.
Thank you for your help.
0
 

Author Comment

by:EuroCasaCar
Comment Utility

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
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…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now