473,399 Members | 3,302 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,399 software developers and data experts.

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 =rptLaborSubReport!TotalLaborCost
TotalLaborCost =Sum((DateDiff("n",[StartTime],[EndTime])/60)*[Pay])

txtTotalHours
=IIf(IsError(rptLaborSubReport!txtTotalHours),0,rp tLaborSubReport!txtTotalHours)
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 1622
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 =rptLaborSubReport!TotalLaborCost
TotalLaborCost =Sum((DateDiff("n",[StartTime],[EndTime])/60)*[Pay])

txtTotalHours
=IIf(IsError(rptLaborSubReport!txtTotalHours),0,rp tLaborSubReport!txtTotalHours)
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.comwrote in message
news:xc*********************@fe07.news.easynews.co m...
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 =rptLaborSubReport!TotalLaborCost
TotalLaborCost =Sum((DateDiff("n",[StartTime],[EndTime])/60)*[Pay])

txtTotalHours
=IIf(IsError(rptLaborSubReport!txtTotalHours),0,rp tLaborSubReport!txtTotalHours)
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...
>txtActualWage =[txtLaborRevenue]\[txtTotalHours]
txtLaborRevenue pulls from a calc control on rptLaborSubreport,
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(rptLaborSubReport!txtTotalHours),0,rp tLaborSubReport!txtTotalHours)

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*****@whitehouse.govwrote in message
news:_Q************@newsfe03.lga...
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.comwrote in message
news:da*********************@fe08.news.easynews.co m...
>Are you pulling in your labor revenue and your total hours separately so
that you can be sure the are pulling in correctly?

yes...
>>txtActualWage =[txtLaborRevenue]\[txtTotalHours]

txtLaborRevenue pulls from a calc control on rptLaborSubreport,
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(rptLaborSubReport!txtTotalHours),0,rp tLaborSubReport!txtTotalHours)

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
(txtLaborRevenue & txtTotalHours) and the calculations are correct. What
would account for the discrepency? Could this be a rounding issue?

"Scott" <sc**********@ns.sympatico.cawrote in message
news:2y********************@ursa-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
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...
6
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...
1
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,...
1
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...
4
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...
1
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...
5
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...
13
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...
7
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.