473,395 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Unable to calculate multiple fields from multiple tables. Help!

Hi all,

I have an Access 2003 database that has been a work in progress for a
while, it's basically a
system inventory and issue tracking system. Recently I have added a
seperate area for keeping

track of total disk space allocation and usage. For the most part I
have the data keyed in but

am pulling my hair out trying to get some calculations.

The main table is very simple, it consists of these fields:

MD - Meta device
MDSize - the size of the meta device

There are only two MDs so far, D60 and D61. Volumes are built on top
of these devices and are

also numbered, i.e. 70, 71, 72, etc. The volumes themselves are in
another table with these

fields:

MD - Meta device upon which this volume is built (this links to MD in
the first table)
Size - size of this volume

So I have MD D60 which houses 70, 71, 71, etc and MD D61 which houses
80, 81, 82, etc.

What I am trying to do is create a form that will keep a running total
of how much is in use and

how much is available. The easy part is the total, that is defined
within "MDSize" of the first

table, that is a static number that will not change. I have done
simple calulations before

within forms using expressions, but this one is throwing me for a
loop. Mainly because I have

to seperate the two MDs, and further break them down by the volumes
built on those MDs.

This is what I envision:

MD D60: Total = 125 Total available = ?
MD D61: Total = 125 Total available = ?

The total available has to be the sum of Size in the second table, but
not the total for ALL mds,

it has to be broken out by each md, i.e.

D60: Total used = 90
D61: Total used = 50

It's easy enough to do a sum on a field, but for the life of me I
cannot get the syntax right to

sum a field based on a given criteria, in this case twice: once for
D60 and once for D61

Then to make things more complicated, once I have obtained this sum, I
need to subtract it from

the MDSize in the first table, again having two seperate calculations.

If this makes any sense to anyone that can offer assistnace, please
let me know! I realize it may

be hard to understand based on my rambling but I will try to answer
any specific questions.

Thanks in advance!

May 17 '07 #1
3 2549
Ok, looking back at this post it looks like a complicated mess! I
managed to get some more work done and I am close but not quite
there. This expression:

=IIf([MD]="D60",Sum([Size]))

*Almost* gives what I need: it searches the [MD] field for the value
"D60" and returns the sum.

Now I just need it to return only the sum of the field [MD] that
contains D60, as it is now it returns ALL of the values...

How can I isolate it so I see the sum of [Size] only where [MD]
equals D60?
May 17 '07 #2

"EyeHaveNoName" <Ey***********@gmail.comwrote in message
news:11**********************@h2g2000hsg.googlegro ups.com...
Ok, looking back at this post it looks like a complicated mess! I
managed to get some more work done and I am close but not quite
there. This expression:

=IIf([MD]="D60",Sum([Size]))

*Almost* gives what I need: it searches the [MD] field for the value
"D60" and returns the sum.

Now I just need it to return only the sum of the field [MD] that
contains D60, as it is now it returns ALL of the values...

How can I isolate it so I see the sum of [Size] only where [MD]
equals D60?

=Sum(IIf([MD]="D60",[Size],0)

May 18 '07 #3
On May 18, 9:06 am, "paii, Ron" <p...@packairinc.comwrote:
How can I isolate it so I see the sum of [Size] only where [MD]
equals D60?

=Sum(IIf([MD]="D60",[Size],0)

Thank you! That is perfect.

May 18 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: sg_s123 | last post by:
============================================================================ 02-Feb-04 03-Feb-04 Staff Staff 0800hr- 1300hr- 1700hr- 1900hr- 0800hr- 1300hr- 1700hr- 1900hr- Number...
7
by: Michael Deathya | last post by:
Hi, I am pulling over 400 different metrics from an Excel spreadsheet into Access (97). Conceptually, each row represents a single set of these 400 metrics. However, because of the 255 column...
11
by: dskillingstad | last post by:
I've been struggling with this problem for some time and have tried multiple solutions with no luck. Let me start with, I'm a novice at Access and I'm not looking for someones help to design my...
5
by: JP SIngh | last post by:
Hi All This is a complicated one, not for the faint hearted :) :) :) Please help if you can how to achieve this search. We have a freetext search entry box to allow users to search the...
1
by: NumberCruncher | last post by:
Hi All, I am struggling with setting up my first system of tables, forms,and reports, and could use your help! I am setting up a database to keep track of the production of a produced item. The...
52
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible...
11
by: shriil | last post by:
Hi I have this database that calculates and stores the incentive amount earned by employees of a particular department. Each record is entered by entering the Date, Shift (morn, eve, or night)...
1
by: nafise | last post by:
Hi, I have a problem in calculating a field in a table. I have 2 tables with these fields: 1- examcode , p1, p2, P 2- examcode, f1, f2 I want to update the first table to calculate the...
3
by: DeanL | last post by:
Hi guys, Does anyone know of a way to create multiple tables using information stored in one table? I have a table with 4 columns (TableName, ColumnName, DataType, DataSize) and wanted to know...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.