在lotusScript中:我使用过:
doc.DocDate = Format(document.get("DatePublished"),"mm/dd/yyyy") 'Rem return 08/22/2017
在公式中:我用来获得年份:
@Year(DocDate)
但是当我运行程序时,我收到错误:"运算符的数据类型不正确,或者预期的@function时间/日期"。如何解决?
答案 0 :(得分:2)
使用
获取日期值document.DatePublished(0)
或
document.GetItemValue("DatePublished")(0)
然后你的字段DocDate应该正确计算。
@Year()
需要NotesDateTime值。但DocDate是一个String值。您可以将公式更改为
@Year(@ToTime(DocDate))
如果您的语言设置设置为美国日期格式,它将起作用。