两个日期/时间字段之间的差异

编程入门 行业动态 更新时间:2024-10-24 08:26:09
本文介绍了两个日期/时间字段之间的差异-Lotus Notes的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有三个可编辑的日期/时间字段,前两个是(字段1和字段2),样式:日历/时间控件.它们都显示时间:小时和分钟,例如:15:51.

I have three editable date/time fields which the first two is (field1 and field2), style: Calendar/time control. Both of them are showing the time: hour and minutes, eg: 15:51.

第三个字段也是(可编辑的),我想显示field1和field2之间的区别.

The third field also (editable) which I want to show the difference between field1 and field2.

例如:如果field1为14:41,field2为14:30,则field3 = 00:11.我已经尝试过field1-field2,但是无法正常工作.该窗体具有自动刷新字段属性.谢谢!

Eg: If field1 is 14:41 and field2 is 14:30, then field3 = 00:11. I've tried field1-field2 but isn't working. The form has automatic refresh fields property. Thanks!

推荐答案

您的第三个字段需要计算,不可编辑.

Your third field needs to be computed, not editable.

如果由于某种原因它必须可编辑,并且您希望它在其他两个字段更改时进行更新,请执行以下操作:

If it HAS to be editable for some reason, and you want it to update when the other two fields are changed, do this:

创建一个新字段,并对其进行计算以进行显示和隐藏.给它一个这样的公式

Create a new field and make it computed-for-display and hidden. Give it a formula like this

@If(field1=null | field2=null; @Return(""); ""); seconds := field1-field2; hours := @Integer(seconds/3600); minutes := @Modulo(@Integer(seconds/60); 60); output := @Right("00" + @Text(hours); 2) + ":" + @Right("00" + @Text(minutes); 2); @setfield("field3"; output); @Command([ViewRefreshFields]); ""

菲尔

更多推荐

两个日期/时间字段之间的差异

本文发布于:2023-10-23 22:42:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1522213.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字段   差异   日期   两个   时间

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!