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

Calculating Overtime and Saturday Rota

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 - qrysummedmonthlyhours - 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 2863
Rabbit
12,516 Expert Mod 8TB
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,556 Expert Mod 16PB
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
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
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...
5
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...
3
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...
3
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...
1
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...
25
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...
1
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...
4
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. ...
8
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
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...
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
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
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,...
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...
0
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...

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.