473,385 Members | 1,320 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,385 software developers and data experts.

Sum columns in a report

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 1517
NeoPa
32,556 Expert Mod 16PB
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
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,556 Expert Mod 16PB
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
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...
2
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...
1
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...
6
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...
2
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...
0
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...
1
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...
2
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...
3
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...
1
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.