如何找工作时间 [英] how to find working hours

查看:75
本文介绍了如何找工作时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过计算入住和退房时间来查找员工的总工作时间?

假设员工工作2小时并因某种原因退房并再次办理登机手续,那么如何查找总工时。在数据库中,时间以datetime格式给出。提前谢谢。

how can i find total working hours for an employee by calculating his check in and check out time?
Suppose if employee work for 2 hrs and check out for some reason and again check in then how to find total working hours. In database time is given in datetime format. thanks in advance.

推荐答案

你打算在哪里进行计算?什么语言?
Where are you going to make your calculations? What language?


必须在sql server 2008中为它创建一个存储过程。
Have to create a stored procedure for it in sql server 2008.


当它们退出时,它是否完全执行了那段时间已经好几个小时?或者,你是否已将其设置为仅输入PunchinTime和PunchoutTime,并希望稍后在某个时间点完成每个时段,如每周,每两周一次等。一个好的应用程序将实时处理总计。示例(希望它适合):


EmpID日期Punchin Punchout PeriodTotalHrs

1 1/20/2012 10:32:00 PM NULL NULL

1/20/2012 10:32:00 PM 04:25:00 AM [现在计算]


(注意这是相同的记录,在Punchout上编辑)


那么你只需要在交付点处总计PeriodTotalHrs列。 (稍后的时间)。


如果您没有设置应用程序来执行此类操作,并且您在那里有Punchin / Punchout时间的记录但没有任何内容在PeriodTotalHrs列中(或者它不存在),那么我们有两种类型的计算要做。你需要两个吗?
When they clock out, does it do any totally of the hours for that period already? Or, do you have it set up to just input the PunchinTime and the PunchoutTime, and want to do the totally per period at some point later, like weekly, biweekly, etc. A good app would handle the totaling in realtime. Example (hope it fits):

EmpID Date Punchin Punchout PeriodTotalHrs
1 1/20/2012 10:32:00PM NULL NULL
1/20/2012 10:32:00PM 04:25:00 AM [calculated now]

(note this is the same record, edited on Punchout)

Then you would just be totaling the PeriodTotalHrs column at the point of "delivery" (a later time).

If you don''t have an app set up to do something like this already, and you have records in there with Punchin/Punchout times but nothing in the PeriodTotalHrs column (or it doesn''t exist), then we have 2 types of calculations to do. Do you need both?


这篇关于如何找工作时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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