计算加班费 [英] Calculating overtime

查看:59
本文介绍了计算加班费的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用访问数据库来跟踪员工时间。我花了几个月的时间来构建这个并且一切都很好,除了我需要能够在飞行中计算加班时间。我有的表是tblTIMES,tblEMPLOYEES和tblHOLIDAYS。除非有假期或休假时间,否则我需要计算一周内工作时间超过40小时的加班时间。我在tblTIMES表中的所有时间记录都有一个时间类型字段(N =正常,H =假日,V =假期等...)。我希望我已经用足够的细节解释了这一点。

解决方案

不是Wesley。有大量的信息缺失,这是有道理的,并且可以正确回答(猜测你的意思后没有我们的一些数字发布)。


您正在使用现场数据,但你只给我们表名。你正在使用哪些领域以及它们如何组合在一起?


感谢NeoPa的响应!!


好​​的。在这里。


tblTIMES表包含以下字段:[TimeID]为自动编号,[EmployeeNo]为数字,[ClockInDate]为日期/时间,[TimeIn]为日期/时间,[ClockOutDate]为日期/时间,[TimeOut]为日期/时间,[TimeType]为文本,[TimeComments]为文本,[CurStatus]为文本。


我使用一个名为HoursAndMinutes()的函数来计算[TimeOut]和[TimeIn]字段之间的时差,并将其格式化为十进制数(例如7.5 = 7小时30分钟)。


每个时钟输入/输出对都存储在tblTIMES表中作为一条记录。然后我运行报告,其中开始日期和结束日期各不相同,具体取决于所选的时间段,列出该时间段的每个记录([ClockInDate],[TimeIn],[ClockOutDate],[TimeOut],[TimeType]和[总时数]使用上述函数HoursAndMinutes()计算得出。


我需要能够确定指定周内的哪些记录,确定加班费是否为需要,并计算加班的总小时数。


如果员工每周工作超过40小时没有休假日或假期,则需要支付加班费。 tblTIMES表中的每条记录都有一个[TimeType]字段,将其指定为正常时间,假期,假日或其他。


tblEMPLOYEES表保存有关每个员工的信息(姓名,员工姓名,出生日期,雇用日期等)


希望这会有所帮助!


顺便说一句,我正在使用Access 2010;)


我刚看完你的如何提出好问题线程。

I am using an access database to keep track of employees times. I have spent several months building this and it all works great, except I need to be able to calculate overtime hours on the fly. The tables I have are tblTIMES, tblEMPLOYEES, and tblHOLIDAYS. I need to calculate the hours worked in a week with anything over 40 hours being overtime unless there is a holiday or vacation time. All of my time records in the tblTIMES table have a timetype field(N=Normal, H=Holiday, V=Vacation, etc...). I hope I have explained this with enough detail.

解决方案

Not really Wesley. There is a large amount of info missing for this to make sense and be properly answerable (without some of our number posting after guessing what you mean).

You are working with field data, yet you give us only table names. What fields are you working with and how do they all fit together?


Thanks for the response NeoPa!!

Ok. Here it goes.

The tblTIMES table has the following fields: [TimeID] as AutoNumber, [EmployeeNo] as Number, [ClockInDate] as Date/Time, [TimeIn] as Date/Time, [ClockOutDate] as Date/Time, [TimeOut] as Date/Time, [TimeType] as Text, [TimeComments] as Text, and [CurStatus] as Text.

I use a function called HoursAndMinutes() to calculate the time difference between the [TimeOut] and [TimeIn] fields and format it into a decimal number (e.g. 7.5 = 7 hours and 30 minutes).

Each Clock In/Out Pair is stored as one record in the tblTIMES Table. I then run reports with the start dates and end dates varying , depending on the time period selected, which lists each record for that period([ClockInDate],[TimeIn], [ClockOutDate], [TimeOut], [TimeType], and [Total Hours] Which is calculated using the aforementioned function "HoursAndMinutes()").

I need to be able to determine which records are in a specified week, determine if overtime pay is needed, and calculate the total hours of overtime.

Overtime is paid when an employee works more than 40 hours per week in which there are no vacation days or holidays. Each record in the tblTIMES table has a [TimeType] Field that specifies it as Normal time, Vacation, Holiday , or Other.

The tblEMPLOYEES table holds information about each employee (Name, EmployeeNo, Birth Date, Hire Date, etc.)

Hope this helps!


By the way I am using Access 2010 ;)

I just read your "How to ask good Questions" Thread.


这篇关于计算加班费的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆