473,473 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Summation in a report

abouddan
42 New Member
Hi all

I am using Access2000 and I am creating a report based on a query.

Query1=" select Id,name,Amount from Eployees"

This query returns many records, so in the report this result must be shown as if continuous. I did that by inserting a report header and footer. But the preblem is that I want the the summation of a particular field 'Amount'. So what I did is creating a text box in the report footer and in it's Data/Row Source I wrote " =Sum([text1])" and it went ok.

The problem rose when the field (text1) is not bounded directly to the query, when in it's row source is writen some code.like:' =iif(amount<1000,name,"") '.
The results in text1 are just what I need but In that text box in the report footer nothing happens.
What am I missing?
Apr 26 '07 #1
7 2301
MMcCarthy
14,534 Recognized Expert Moderator MVP
Hi all

I am using Access2000 and I am creating a report based on a query.

Query1=" select Id,name,Amount from Eployees"

This query returns many records, so in the report this result must be shown as if continuous. I did that by inserting a report header and footer. But the preblem is that I want the the summation of a particular field 'Amount'. So what I did is creating a text box in the report footer and in it's Data/Row Source I wrote " =Sum([text1])" and it went ok.

The problem rose when the field (text1) is not bounded directly to the query, when in it's row source is writen some code.like:' =iif(amount<1000,name,"") '.
The results in text1 are just what I need but In that text box in the report footer nothing happens.
What am I missing?
You can't sum a calcuated field by textbox name. Try something like this ...

Expand|Select|Wrap|Line Numbers
  1. =Sum(IIf(amount<1000,amount,0))
Apr 26 '07 #2
abouddan
42 New Member
You can't sum a calcuated field by textbox name. Try something like this ...

Expand|Select|Wrap|Line Numbers
  1. =Sum(IIf(amount<1000,amount,0))



Maybe I didn't axplain well. In the detail section I have a text 'Text1' that calculates a value. It's row source looks like: =IIf(amount<1000,amount,0)
The 'amount' is a field from the query.
Outside of the Details section, In the report footer I have an other TextBox 'Text2' having in it's row source: = Sum(Text1)

The summation is not working when in Text1 the data is calculated otherwise when Text1 is directly bounded to the query and having 'amount' as row source everything goes right.
Apr 26 '07 #3
MMcCarthy
14,534 Recognized Expert Moderator MVP
Maybe I didn't axplain well. In the detail section I have a text 'Text1' that calculates a value. It's row source looks like: =IIf(amount<1000,amount,0)
The 'amount' is a field from the query.
Outside of the Details section, In the report footer I have an other TextBox 'Text2' having in it's row source: = Sum(Text1)

The summation is not working when in Text1 the data is calculated otherwise when Text1 is directly bounded to the query and having 'amount' as row source everything goes right.
Did you try putting what I gave you in Text2?
Apr 26 '07 #4
abouddan
42 New Member
Did you try putting what I gave you in Text2?

Thanks Mary for the support

I tried what you said and it worked very well. But I want to ask: how did that happened? If you can explain. Knowing that Text2 is running once so I expect to calculate the last Record only.
Apr 27 '07 #5
MMcCarthy
14,534 Recognized Expert Moderator MVP
Thanks Mary for the support

I tried what you said and it worked very well. But I want to ask: how did that happened? If you can explain. Knowing that Text2 is running once so I expect to calculate the last Record only.
Don't understand what you mean by the last sentence.

The reason it works is that ...

You can't sum() on Text1 because it is a calculated field and you can't aggregate (sum, count, etc.) on calculated fields. However, you can sum() on the calculation itself.
Apr 27 '07 #6
abouddan
42 New Member
Don't understand what you mean by the last sentence.

The reason it works is that ...

You can't sum() on Text1 because it is a calculated field and you can't aggregate (sum, count, etc.) on calculated fields. However, you can sum() on the calculation itself.

Thanks for the explanation
What I ment is that Text2 is filled once at the openning of the report, true?
so how can he caculate the result of a query that returns many records?
Apr 28 '07 #7
MMcCarthy
14,534 Recognized Expert Moderator MVP
Thanks for the explanation
What I ment is that Text2 is filled once at the openning of the report, true?
so how can he caculate the result of a query that returns many records?
Text2 is in the report footer so is calculated after the fill of all details
Apr 28 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: CSDunn | last post by:
Hello, I have a situation with MS Access 2000 in which I need to display report data in spreadsheet orientation (much like a datasheet view for a form). If you think of the report in terms of what...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
6
by: Bob Alston | last post by:
I am looking for Access reporting add-in that would be easy to use by end users. My key focus is on selection criteria. I am very happy with the Access report writer capabilities. As far as...
1
by: lorirobn | last post by:
Hi, I have a report that works just fine. Now I would like to add the capability to choose selection criteria to limit what is displayed. I created several reports that do this, but they used...
1
by: crazydrummer | last post by:
hi everyone, fairly new to access and VBA, but have fundamental knowledge. as part of a college project i am building a database that records "downtime" for machines in a company. the...
6
by: logieen | last post by:
Hi , Every one I have a problem to solve this summation in c++ ; 1/3 + 3/5 +5/7 ....... this the program I wrote #include <stdio.h> #include <iostream.h> #include <conio.h> #include...
25
by: Darsin | last post by:
Hi all I need to perform a summation on a column of a table based on a criteria given in another column in the same table. The catch is i need to perform different sums according to the number of...
32
by: =?ISO-8859-1?Q?Szabolcs_Horv=E1t?= | last post by:
I did the following calculation: Generated a list of a million random numbers between 0 and 1, constructed a new list by subtracting the mean value from each number, and then calculated the mean...
2
by: galaxianape | last post by:
Please help me with summation in C lang. I m trying to divide the summation of alpha * delta with summation of alpha this is half the program that i have written...but it gives error. pls help.....
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.