473,799 Members | 2,929 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calculating Overtime and Saturday Rota

3 New Member
Hi,

How can I group in my qryMonthlyHours in SQL view by [EmployeeName], [WkComDate] and then sum [TotalHrs] done in that month?

I have another query - qrySaturdayRota

[ProjectCode],[WorkCode],[Sat],[PartNumber],[EmployeeName],[WkComDate][SumOfTotalHrs] ALL THIS IS GROUPED EXCEPT FOR [SumOfTotalHrs]

[PartNumber] has a criteria = Like "Saturday Rota" Or Like "Sat Rota" Or Like "Rota"

Another query - qrysummedmonthl yhours - so far I have

[EmployeeName],[SumOfTotalHrs],

I need this query to work out any overtime (overtime is only recognised if it is over 50 hrs per week) from qryMonthlyHours .

I then need it to Work off the qrySaturdayRota (if someone has worked a Saturday on the Rota it needs to add 4 hours in a new column, but the plot thickens:

if that employee has any overtime, ie if they have 55 hours overtime then their overtime needs to minus 4 hours and leave 1 hour in the [SumOfTotalHrs] and record 4 Hours in a SaturdayRota column BUT

if the employee has no overtime 4 hours still needs to be recorded.

This sounds complicated even to me I hope you understand what I am trying to do and can help me in anyway possible.

Thanks
Mar 2 '07 #1
3 2903
Rabbit
12,516 Recognized Expert Moderator MVP
Expand|Select|Wrap|Line Numbers
  1. SELECT [EmployeeName], [WkComDate], Sum([TotalHrs]) As SumOfTotalHrs
  2. FROM [Table Name]
  3. GROUP BY [EmployeeName], [WkComDate];
As for the second part, could you provide a couple of examples?
Mar 2 '07 #2
NeoPa
32,579 Recognized Expert Moderator MVP
I would suggest asking these questions one at a time. It's very hard to focus on many items at once. When one aspect has been satisfactorily answered, then move on to the next. It's also easier for you to explain one thing at a time (As you noticed when you read it back to yourself ;)).
They can probably proceed each other in this single thread without problem.
Mar 3 '07 #3
foxykitty
3 New Member
Expand|Select|Wrap|Line Numbers
  1. SELECT [EmployeeName], [WkComDate], Sum([TotalHrs]) As SumOfTotalHrs
  2. FROM [Table Name]
  3. GROUP BY [EmployeeName], [WkComDate];
As for the second part, could you provide a couple of examples?

Thank you for responding and sorry for the confusion of the 2nd part of the question.

Ie.
(Another Field Added)
[EmployeeName] [SumOfTotalHrs] [SaturdayRota]
(Overtime 50+ hrs)

Foxykitty 1 4

What I need is to some way workoutand display in the report and query the following:

Foxykitty has done 55 hrs total in a week and in that week she worked a SaturdayRota. So she has in effect only worked 1 hr overtime and 4 hours on the SaturdayRota (the 2 are paid out in different rates). So maybe I need another field which works out the total hours and then does the calculations - this is where I am lost.

But

If Foxykitty has done 45 hrs overtime and done 4 hours of the Saturday Rota then in effect she won't get any Overtime but will get 4 hours for working SaturdayRota.

I hope that this is more clearer or understandable?

Thanks
Mar 5 '07 #4

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

Similar topics

2
5381
by: Eric Whittaker | last post by:
here's my dilemma, on the program below, i am trying to calculate overtime pay at time and a half, but instead of only counting the hours after 40, it counts all hrs at that rate, how can i avoid this? thanks. // figures hourly wages for employees #include <iostream> #include <conio.h> using std::cout;
5
12996
by: Jamie Pittman via AccessMonster.com | last post by:
I have two tables with 5000 entries on them. One is based for regular time with several variables example (employee name, date,time in and out, code, customer, building) I have another table that works with overtime but has the same feilds within the table. I want to be able to run a report that combines the regular time and overtime for the warehouse and seperated by each customer. I have tried join tables but I keep ending with, (if it...
3
2268
by: michb | last post by:
I need to be able to calculate on a daily basis, both normal and overtime hours for both payroll and job costing. I also then need to calculate the above on a weekly basis, in order to complete the payroll. I have employee normal, time/half and double time rates in $value in one table, then in another I have log in and out times; then another job start and stop time. I realize the code is probably logical-but I am not brilliant with
3
2389
by: dpmcdoug | last post by:
I am a relative novice with Access and I am developing an input form that I need a default date to populate, regardless of the input date e.g. If I input data on Tuesday, Sept 27, I want the default date to be the previous Saturday, Sept 23 or if I enter data on Friday, Sept 29, the default date should also be Saturday, Sept 23. Is there a way to do this with date math, since the input date could be any date from the 23rd through the 29th. ...
1
2413
by: hakunamatata5254 | last post by:
Hi all, In my project of multiple forms (main form, subform1, 2 , 3 etc) (Main form is Employees, Subforms are Attendance, salary details, payment) Now i want to calculate the payment based on the salary details (Basic, Allowances etc) and the attendance (days worked and overtime hours). Overtime pay should be based on the basic only. Maybe the following codes/syntax (from microsoft) will help. To refer to a control on a subform,...
25
5030
by: Umesh | last post by:
i want to calculate the time required to execute a program. Also i want to calcute the time remaining for the execution of the program. how can i do that? pl mention some good websites for learning advanced C.thx.
1
2478
cori25
by: cori25 | last post by:
Employee's input the shifts they want, once I have all this data I need to determine who will get what shifts depending on a reliability %, if thats the same then I look at the time stamp. I have come to the point where I am pulling out the duplicate date's in a query. Name Date Shift Reliability Buck, Jack 1/2/2008 4:00 PM-12:30 AM 0.16254 smith, frank 1/2/2008 4:00 PM-12:30 AM 0 Jones,...
4
5181
by: jriechers | last post by:
I need to create a database that will be used to schedule patches. Many of our patches happen on the 1st Saturday of the month, but some happen on the 2nd Thursday after the 1st Tuesday every month. Ive been attempting to use the DATEPART and WEEKDAY functions but without success. Figuring out the 1st Saturday shouldnt be to hard, even if I havent managed to figure that out just yet, but the other is beyond my experience.
8
7523
by: =?Utf-8?B?QWw=?= | last post by:
I am working in vb2005. how can I calculate business days (not including holidays and weekends) between 2 dates? thanks Al
0
9686
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
9540
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
10475
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
10250
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
6805
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
5463
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
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.