运算符的数据类型不正确或者在lotusscript上预期的@function时间/日期?

时间:2017-08-22 03:41:44

标签: lotus-notes lotus-domino lotus lotus-formula

在lotusScript中:我使用过:

doc.DocDate = Format(document.get("DatePublished"),"mm/dd/yyyy") 'Rem return 08/22/2017

在公式中:我用来获得年份:

@Year(DocDate)

但是当我运行程序时,我收到错误:"运算符的数据类型不正确,或者预期的@function时间/日期"。如何解决?

1 个答案:

答案 0 :(得分:2)

使用

获取日期值
document.DatePublished(0)

document.GetItemValue("DatePublished")(0)

然后你的字段DocDate应该正确计算。

@Year()需要NotesDateTime值。但DocDate是一个String值。您可以将公式更改为

@Year(@ToTime(DocDate))

如果您的语言设置设置为美国日期格式,它将起作用。