我有两个可编辑的时间/日期字段,TimeIn
和TimeOut
,以及一个计算显示领域hoursWorked
总和,它的作用是让TimeIn
和TimeOut
之间的差异,以小时为单位显示出来:分钟,例如: (02:30)。我决定拥有另一个可编辑的时间/日期字段TimeIn_1
和TimeOut_1
字段,并计算显示字段hoursWorked
,并计算显示字段totalHours
的另一个字段,该字段显示hoursWorked
和hoursWorked_1
小时的总和/总和。我试过这个代码:的Lotus Notes:小时
thours:[email protected](hoursWorked=null | hoursWorked_1=null; @Return(""); "");
seconds := hoursWorked+hoursWorked_1;
hours := @Integer(seconds/3600);
minutes := @Integer(@Modulo(seconds;3600)/60);
output := @Right("00" + @Text(hours); 2) + ":" + @Right("00" + @Text(minutes); 2);
@TextToTime(output)
但没有任何反应。你可以帮我吗?
totalHours字段的类型是什么?你想在第一行代码中做什么?如果你删除它会发生什么? (注意:你知道在Notes公式语言中null不是关键字吗?它作为一个对'null'变量的引用 - 在大多数情况下当然是未初始化的,但理论上可能有一个非空值) –
'totalHours'字段的类型是文本。第一行代码是检查两个字段的值是否为空,并返回值0,因为我有时会得到一个错误,是正确的吗? – drayl