有一个 View 列出了一定数量的文档,具有一个表单作为 View 选择。列(显示 Time
的 Style = Date/Time
)具有公式:time_1
。下一列显示:time_2
。
换句话说:
time_1
- 用户工作的时间。
time_2
- 用户必须工作的时间(假设为 08:00)。
有一个查看操作按钮:
t1:=@DbColumn("Notes":"NoCache";"server/Company":"Name.nsf";"vwSearchResult";6);
total1:= @Sum(@ToNumber(t1)) ;
t2:=@DbColumn("Notes":"NoCache";"server/Company":"Name.nsf";"vwSearchResult";7);
total2:= @Sum(@ToNumber(t2)) ;
zile:=(total1-total2)/8; // 8 - is the minimun number of hours / day. " I must be at work minimum 8 hours "
@Prompt([Ok];"Time at work";@Text(total1));
@Prompt([Ok];"expected time";@Text(total2));
@Prompt([Ok];"Additional time - in days ";@Text(zile))
只有第二个提示计算正确。第一个提示结果是一个整数,当然,第三个提示隐含地没有正确显示结果。
我怎样才能实现这个目标?
最佳答案
将公式更改为
t1:=@DbColumn("Notes":"NoCache";"server/Company":"Name.nsf";"vwSearchResult";6);
total1:= @Sum(t1 - [00:00]) / 3600;
t2:=@DbColumn("Notes":"NoCache";"server/Company":"Name.nsf";"vwSearchResult";7);
total2:= @Sum(t2 - [00:00]) / 3600;
您无法使用@ToNumber 将时间值转换为数字。相反,请计算您的时间与 00:00 之间的时差。这将为您提供时间的秒数。
将其除以 3600,即可得到小时数。
关于lotus-notes - Lotus Notes计算查看条目的总时间/天数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26501178/