lotus-notes - Lotus Notes计算查看条目的总时间/天数

标签 lotus-notes

有一个 View 列出了一定数量的文档,具有一个表单作为 View 选择。列(显示 TimeStyle = 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/

相关文章:

excel - LotusScript 代理从 csv 文件向多个收件人发送邮件

lotus-notes - Lotus Notes - 将电子邮件导出到纯文本文件

build - 为什么本地应用程序的构建时间受网络影响?

lotus-notes - Lotus Notes 和 C# : NotesRichTextItem how to recreate content or loop through elements in respective order

database - 为什么我不能访问具有 ACL 上的管理员访问权限的 Notes 数据库?

java - 使用 Java 在 Lotus Notes 中获取今天的日历条目

java - 使用 probablePrime 生成素数。 probablePrime(512, 随机种子);

lotus-notes - 在 Lotus Notes 中根据具有数值的文本字段对 View 进行排序时出现问题

java - 如何从 Lotus Notes 启动应用程序,然后保存到 Lotus 数据库?

java - 如何以编程方式创建新邮件消息以在 Lotus Notes 中进行编辑?