计算超时和超时的工作时间 [英] Calculate Work Hours of Time in and Time Out
问题描述
祝所有开发人员都在这里.
我想知道的第一件事是如何计算工作时间.我正在使用VB.Net 2008,MySQL作为我的后端以及.Net的Crystal Reports用于出勤报告目的
假设我们有一个名为Name,Date,Time_in和Time_out的数据库字段
值是
姓名:约书亚
日期:2012年5月17日
Time_in:1:30 AM
超时:5:30 AM
预期结果应为:4
我设法在Crystal报表中显示名称,日期,Time_in和Time_out,但是我真的不知道如何计算我尝试过的公式字段和dateandtime函数的工作时间,但是它对我不起作用.
谁能帮我个好开始
谢谢
Hi Good day to all developers here.
First thing i would like to know is how can i calculate the number of work hours. I am using VB.Net 2008, MySQL as my Back end and Crystal Reports of .Net for Attendance reporting purposes
Assuming We have a database fields of Name, Date, Time_in & Time_out
and the values are,
Name: Joshua
Date: 5/17/2012
Time_in: 1:30 AM
Time_out: 5:30 AM
Expected Result Should Be: 4
I managed to display the name, Date, Time_in and Time_out in Crystal reports however i do not really know how to calculate the work hours i tried formula fields and dateandtime functions but it doesn''t work for me.
Can anyone give me a hand for me to have a good start
Thanks
推荐答案
Crystal应该支持DateDiff函数,因此您可以尝试设置类似
的公式
Crystal should support the DateDiff function so you could try to set up the formula like
DateDiff ("h", {Time_in}, {Time_out})
如果在VB.Net的DateTime实例中放入时间和超时,则可以减去它们.
If put the time in and time out into DateTime instances in VB.Net, you can just subtract them.
这篇关于计算超时和超时的工作时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!