减去同一天内的日期和时间字段 [英] Subtracting date and time field within the same day

查看:85
本文介绍了减去同一天内的日期和时间字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在InfoPath新表格中计算时差似乎很容易,但我无法为其提供答案.我没有重复表,因此我检查的所有资源都具有重复表,并且在尝试时无法使用.

It seems easy to calculate time difference in InfoPath new form but I couldn’t gate an answer for it. I don’t have a repeating table so all the resources I checked has repeating table and couldn’t work when I tried.

我正在使用sharepoint在线版本和InfoPath 2013

I'm on sharepoint online version and InfoPath 2013

我要实现的目标如下,

我在SharePoint列表中有三个字段,并且表单是在InfoPath中自定义的

I have three fields in a SharePoint list and the form is customized in InfoPath

1,进入时间

2,超时

3,总时数

超时-进入时间=总小时数

Time out -Time In= Total hour

9:00 AM-8:00 AM = 1:00

9:00 AM-8:00 AM= 1:00

如果两个filds(time in和timeout)都具有值,我希望在保存之前在新的或编辑的表单上显示结果1:00,

I want the result 1:00 to be desplayed on a new or edit form before save, if the two filds(time in and time out) have value

请记住,我没有重复的桌子.我目前在总工作时间"字段中使用SharePoint计算字段,但是问题是,当用户输入他们的超时和超时字段时,它没有在表单上显示他们的总工作时间.如果还有另一个 解决方案愿意保留SharePoint计算的总小时数字段,并在InfoPath中创建另一个.

please remember I don’t have a repeating table. I currently use a SharePoint calculated field for the Total Hours field but the problem is when users inter their time in and time out field, it doesn’t show them their total hour on the form. If there is another solution am willing to leave the SharePoint calculated total hour field and create another one inside InfoPath.

谢谢您的帮助!

推荐答案

嗨Amoraw,

Hi Amoraw, 

根据您的描述,您希望计算两次之间的小时数.

From your description, you want to calculate hours between two times. 

要计算两次之间的小时数,可以使用以下公式创建计算列:

To calculate hours between two times, you can create calculate column using the following formula:

总小时数= INT(([[Time out]-[Time In]] * 24)

Total hour=INT(([Time out]-[Time In])*24)

当差异不超过24时,您还可以使用以下公式:

When the difference does not exceed 24, you can also use the following formulas:

总小时数= HOUR([超时]-[超时])

总小时数= TEXT([超时]-[超时],"h")

请参阅以下文章中的计算两次之间的时差"部分:

https://msdn.microsoft.com/en-us/library /office/bb862071(v=office.14).aspx

最好的问候,

丽莎·陈(Lisa Chen)

Total hour=HOUR([Time out]-[Time In])

Total hour=TEXT([Time out]-[Time In],"h")

Refer to the Calculate the difference between two times section in the following article:

https://msdn.microsoft.com/en-us/library/office/bb862071(v=office.14).aspx

Best Regards, 

Lisa Chen 



这篇关于减去同一天内的日期和时间字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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