473,836 Members | 1,444 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Report calculations are wrong on some records but not others

On some records, the calculation is correct but on others it is wrong, why?

the calculation is as follows (the source of each part of the calculation is
below it):

txtActualWage =[txtLaborRevenue]\[txtTotalHours]

txtLaborRevenue =rptLaborSubRep ort!TotalLaborC ost
TotalLaborCost =Sum((DateDiff( "n",[StartTime],[EndTime])/60)*[Pay])

txtTotalHours
=IIf(IsError(rp tLaborSubReport !txtTotalHours) ,0,rptLaborSubR eport!txtTotalH ours)
txtTotalHours =Sum(DateDiff(" n",[StartTime],[EndTime])/60)

So in example one...
txtActualWage =[txtLaborRevenue]\[txtTotalHours]
$25.00 $912.50 36.50

in example two...
txtActualWage =[txtLaborRevenue]\[txtTotalHours]
$23.00 $187.50 7.50

why is this wrong? are my calculation to complex? using too many calculated
controls for the end result?

Any guidance greatly appreciated.
Apr 21 '07 #1
6 1647
Kevin wrote:
On some records, the calculation is correct but on others it is wrong, why?

the calculation is as follows (the source of each part of the calculation is
below it):

txtActualWage =[txtLaborRevenue]\[txtTotalHours]

txtLaborRevenue =rptLaborSubRep ort!TotalLaborC ost
TotalLaborCost =Sum((DateDiff( "n",[StartTime],[EndTime])/60)*[Pay])

txtTotalHours
=IIf(IsError(rp tLaborSubReport !txtTotalHours) ,0,rptLaborSubR eport!txtTotalH ours)
txtTotalHours =Sum(DateDiff(" n",[StartTime],[EndTime])/60)

So in example one...
txtActualWage =[txtLaborRevenue]\[txtTotalHours]
$25.00 $912.50 36.50

in example two...
txtActualWage =[txtLaborRevenue]\[txtTotalHours]
$23.00 $187.50 7.50

why is this wrong? are my calculation to complex? using too many calculated
controls for the end result?

Any guidance greatly appreciated.

What if there are no hours, i.e. Salary Employee?
Apr 22 '07 #2
Are you pulling in your labor revenue and your total hours separately so
that you can be sure the are pulling in correctly?

"Kevin" <no**@email.com wrote in message
news:xc******** *************@f e07.news.easyne ws.com...
On some records, the calculation is correct but on others it is wrong,
why?

the calculation is as follows (the source of each part of the calculation
is below it):

txtActualWage =[txtLaborRevenue]\[txtTotalHours]

txtLaborRevenue =rptLaborSubRep ort!TotalLaborC ost
TotalLaborCost =Sum((DateDiff( "n",[StartTime],[EndTime])/60)*[Pay])

txtTotalHours
=IIf(IsError(rp tLaborSubReport !txtTotalHours) ,0,rptLaborSubR eport!txtTotalH ours)
txtTotalHours =Sum(DateDiff(" n",[StartTime],[EndTime])/60)

So in example one...
txtActualWage =[txtLaborRevenue]\[txtTotalHours]
$25.00 $912.50 36.50

in example two...
txtActualWage =[txtLaborRevenue]\[txtTotalHours]
$23.00 $187.50 7.50

why is this wrong? are my calculation to complex? using too many
calculated controls for the end result?

Any guidance greatly appreciated.


Apr 22 '07 #3
Are you pulling in your labor revenue and your total hours separately so
that you can be sure the are pulling in correctly?
yes...
>txtActualWag e =[txtLaborRevenue]\[txtTotalHours]
txtLaborRevenue pulls from a calc control on rptLaborSubrepo rt,
TotalLaborCost. This calculated control, TotalLaborCost uses the
calculation - =Sum((DateDiff( "n",[StartTime],[EndTime])/60)*[Pay])

and txtTotalHours is from the same subreport, a control named txtTotalHours
which uses the following calculation -
=IIf(IsError(rp tLaborSubReport !txtTotalHours) ,0,rptLaborSubR eport!txtTotalH ours)

I toyed with the idea of a rounding discrpency but that doesnt seem to fit.
The data type for the various fields are appropriate; StartTime EndTime are
both Date/Time fields, Pay is a currency field. As for the formatting of the
calculated controls; txtTotalHours is Fixed with 2 decimals, txtLaborRevenue
is Currency and txtActualWage is currency.
Apr 22 '07 #4
I'm not sure I see where this is relevent to the question at hand?

"Last Boy Scout" <Ba*****@whiteh ouse.govwrote in message
news:_Q******** ****@newsfe03.l ga...
What if there are no hours, i.e. Salary Employee?


Apr 22 '07 #5
So if you have your two fields pulling in correctly, the revenue field and
the hours field, have you tried running your calculation from these two
fields and not pulling the information from the subreport?

"Kevin" <no**@email.com wrote in message
news:da******** *************@f e08.news.easyne ws.com...
>Are you pulling in your labor revenue and your total hours separately so
that you can be sure the are pulling in correctly?

yes...
>>txtActualWa ge =[txtLaborRevenue]\[txtTotalHours]

txtLaborRevenue pulls from a calc control on rptLaborSubrepo rt,
TotalLaborCost. This calculated control, TotalLaborCost uses the
calculation - =Sum((DateDiff( "n",[StartTime],[EndTime])/60)*[Pay])

and txtTotalHours is from the same subreport, a control named
txtTotalHours which uses the following calculation -
=IIf(IsError(rp tLaborSubReport !txtTotalHours) ,0,rptLaborSubR eport!txtTotalH ours)

I toyed with the idea of a rounding discrpency but that doesnt seem to
fit. The data type for the various fields are appropriate; StartTime
EndTime are both Date/Time fields, Pay is a currency field. As for the
formatting of the calculated controls; txtTotalHours is Fixed with 2
decimals, txtLaborRevenue is Currency and txtActualWage is currency.

Apr 22 '07 #6
Rather than using the calculation =[txtLaborRevenue]\[txtTotalHours], I
substitued the formulas from the calculated fields on my report
(txtLaborRevenu e & txtTotalHours) and the calculations are correct. What
would account for the discrepency? Could this be a rounding issue?

"Scott" <sc**********@n s.sympatico.caw rote in message
news:2y******** ************@ur sa-nb00s0.nbnet.nb .ca...
So if you have your two fields pulling in correctly, the revenue field and
the hours field, have you tried running your calculation from these two
fields and not pulling the information from the subreport?

Apr 22 '07 #7

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

Similar topics

3
1398
by: CSDunn | last post by:
Hello, I have a situation in which each record on a report has 40 fields, any one of which can contain a value of 'C', or 'I', or 'B'. I need to create one calculated field on the report that will COUNT the number of fields with a value of 'C'(and shows the integer result), and another calculation that will take the COUNT of the fields with a value of 'C' and divide that by the total number of fields. The second calculation would be...
6
13150
by: Robin Cushman | last post by:
Hi all, I need some help -- I'm working with an A2K database, using DAO, and am trying to read records into a Crystal Report and then export it to a folder on our network as an Excel spreadsheet. I'm having trouble with my code at the point at which it hits ".ReadRecords" -- the module just runs and runs without generating anything. I've gotten this code to correctly save .rpt files without any data, but not with data, nor have I been...
1
1418
by: Richard Hollenbeck | last post by:
I have a report that displays the final grade for each students in a course in the body of the report, in a text box called "txtAvg". Now I want the report to display number of As, Bs, Cs, Ds, and Fs. and the average grade and median grade, and perhaps a bar chart. The report is called "rptStudentAverages." I tried the following as the control source in a text box to display the number of Bs, for example, but, of course, it doesn't...
1
1750
by: Jessica | last post by:
I have a database where a person is able to enter the different tasks they do each day by specific department and matter. On a form they enter the date, their name, and their title; in a subform they select from a drop down list what department/section this task pertains to and then they select the matter they are discussing or working on with that department. They enter the time they spent on this matter and they also enter some more...
4
1727
by: Richard Hollenbeck | last post by:
The following query takes about one second to execute with less than 1,000 records, but the report that's based on it takes from 15-30 seconds to format and display. That's frustrating for both me and the end user. The report is a student grades sheet showing the results of all his/her activities and final grade for all students in any course--one page per student. Should I break this into several smaller queries? use DAO inside the...
1
1808
by: prabhukalyan | last post by:
Hi all, I am not so good in queries. here is my problem 2 tables to store the received items (fabric)-- inwardmaster, inwarddetails and after some processing (Dyeing) the items were deliverd and stored in tables -- deliverymaster, deliverydetails
5
3743
by: jmar | last post by:
I posted a week ago and received one response. I'm looking for the opinion of several experienced .NET people before I proceed so I'm posting again. Sorry for the repost... I am updating a VB4.0 quote generation program to VB.net. The old program takes user inputs, performs calculations, saves the data to Access databases and uses Crystal Reports 5.0 to generate a quote. A while back users obviously wanted to be able to edit/e-mail ...
13
14950
by: Greg | last post by:
Most suggestions on this topic recommend to use a page footer and make it visible only on the last page. My problem is that the footer is half of the height of a page which means the detail would show on only the top half of each page with whitepace at the bottom of each page. How can I get the detail to fill each page with my "half page height" report footer at the bottom of the last page? Any suggestions to solve this would be...
7
3664
by: Sunil Korah | last post by:
Hi, I haven't used access reports much. I have a problem in getting the total of a group. I have 3 fields, ProgName (Program name), Pname (Participant's name) and PCategory (Participant category) PCategory can have values 'SC', 'ST' and 'Others'
0
9825
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9671
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10852
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10556
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10257
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9383
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6980
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
4022
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3116
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.