473,748 Members | 10,028 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sum columns in a report

21 New Member
Good Day All, I have a report that shows the hours that are worked by employees, who get paid on a biweekly basis. There is a "Total Hours Worked" column that is further divided into "Week1" and "Week2." It looks like this example:

[HTML]Total Hours Worked
Week1 Week2
8.00
8.00
9.00
9.00
10.00
3.50
6.00
6.00
6.00
6.00
---------------------
44.00 27.50[/HTML]

The reason I have the "Total Hours Worked" column divided into Week1 and Week2 is because I want to be able to calculate whether an employee has worked more than 40 hours per week for Overtime purposes.

The control source for the Week1 work hours is a field named txtWeek1 and here is the code that I use

Expand|Select|Wrap|Line Numbers
  1. =IIF([DateIn]-Forms!frmDates4Pay.txtDateBegin<7,(Format([TimeWorked],"#.00")),"  ")
And the control source for the Week2 work hours is a field named txtWeek2 and here is the code that I use

Expand|Select|Wrap|Line Numbers
  1. =IIF([DateIn]-Forms!frmDates4Pay.txtDateBegin>6,(Format([TimeWorked],"#.00")),"  ")
The code described above works just as I expect. However, I want to be able to add the columns separately, and my problem is that the fields that I am using to calculate the sum of the time worked is calculating both weeks for each field. I am using a simple Sum Statement for both total fields:

Expand|Select|Wrap|Line Numbers
  1. =Format(Sum([TimeWorked]),"#.00")
Is there a way to sum only those hours under Week1 in a total field separately from the hours in Week2? Those fields are named txtSumWeek1 and txtSumWeek2. As it stands now, both of these fields has the two weeks total displayed. FYI, the user inputs the payperiod begin and end dates from a form named frmDates4Pay and the click event to preview the form filters all days worked to between date begin and date end of the payperiod.

I am running XP and using Access 2002 in 2000 mode.

Any assistance will be greatly appreciated,

David
May 8 '07 #1
3 1526
NeoPa
32,570 Recognized Expert Moderator MVP
You've posted this in the Access Articles (rather than Access Forum) section.
I will move it across for you.

MODERATOR.
May 8 '07 #2
djsdaddy
21 New Member
Thanks NeoPa, I recognized the mistake as soon as I hit the submit button and re-posted it myself int he appropriate Forum.

David
May 8 '07 #3
NeoPa
32,570 Recognized Expert Moderator MVP
Right you are David. Thanks for letting me know :)
I'll lock this thread then to avoid confusion. Your other one will be the one to continue.
May 8 '07 #4

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

Similar topics

2
2621
by: mary | last post by:
I need to display 10 fields (columns) to display in a crystal Report. When I am trying to print the report some of the columns are cutting off from the report. Is there any way to display the report horizontally. I am using Crystal Report 9. Please some body help me Thanks mary
2
2855
by: DFS | last post by:
Main report contains one large graph in the detail band (no detail records). Subreport snakes just fine (5 columns) when opening by itself. When I add it to the main report (in the report footer), it shows just 1 column and spills over to 5 pages. I've tried moving the subreport to the detail band: no go. All bands/objects are set to Grow and Shrink. Any ideas?
1
1502
by: Peter Bailey | last post by:
I have a report that gives the classroom and then a list of students in it for a particular week. Thats fine if I want just one column with its associated rows of students. I have been asked to produce it so that it gives multiple columns of five rows. so: Classroom xxx
6
38289
by: Chuck | last post by:
I have a report with three columns, accross then down, and two groups. Currently the group headers are only one column wide and appear in the left hand column. How can I make the group header be centered accross all columns? Chuck ....
2
3382
by: Ross Hamilton | last post by:
Can anyone help me with this small problem. I have a report that is divided into 3 Columns using the page setup, It displays the report fields in 3 separate columns (Desc & Pg Num) but it only displays the Page Header on the first column. Any thoughts?? regards,
0
1299
by: BerkshireGuy | last post by:
Hello everyone, I have a subreport that calculates a YTD average. The main report shows the averages by month. So the subreport has the same columns as the main report. Is there a way to easily line up the columns on the subreport with the columns on the main report?
1
1664
by: Don Sealer | last post by:
I have a report that reports from a query. The report lists numbers. The problem is there are over 100 numbers. The report shows this as one column of numbers over 4 pages. How can I get multiple columns on one page? I've tried the properties boxes for the detail and report footer. I've tried combinations of the "force new page" and "new row or col" but haven't been able to get all these numbers in multiple columns on one page. I'm...
2
2537
by: scott.k.fraley | last post by:
....and the SELECT thats trying to pull from said Query doesn't like it one bit! ;) I'm working on this project (in Access 2002) and there is a report who's RecordSource is the following SELECT; SELECT xTab.FirstOfPRIORITZTN_STATUS_NAME, xTab., iif(IsNull( xTab. ), 0, xTab.) AS ,
3
3494
by: Niranjan | last post by:
I want create a report based on the crosstab query which normally returns about 50 - 60 columns. The columns have names of the counties and they keep changing for every session. Is there a way to program a dynamic multi-page crosstab report?
1
1698
by: jglabas | last post by:
For a report, I am using a query as my record source. The query produces 5 columns by 3272 records. The data in columns 1 & 2 (“Objective” and “Rating”) repeats every 409 records The data for “initial” and “Date” are unique for the individual. Currently there are 8 individuals (409 * 8 = 3272) . . . . .. . . . .Objective . . . Rating . . Initial . . . .. Date . . . . . Name . . . . .abc. . . . . . .a. . . . . . jg. . . . . .1/12/07 . ....
0
8984
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
8823
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,...
1
9312
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9238
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
8237
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
6073
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();...
0
4864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3300
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 we have to send another system
2
2775
muto222
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.