Incorrect data type for operator or @function time/date expected on lotusscript?

*爱你&永不变心* 提交于 2019-12-12 04:35:27

问题


In lotusScript: I've used:

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

In formula: I've used for to get year:

@Year(DocDate)

But when i run the program i get the error : "incorrect data type for operator or @function time/date expected". How to fix it?


回答1:


Get date value with

document.DatePublished(0)

or

document.GetItemValue("DatePublished")(0)

Then your field DocDate should be calculated properly.

@Year() expects a NotesDateTime value. DocDate is a String value though. You can change your formula to

@Year(@ToTime(DocDate))

and it will work if your language settings are set to US date format.



来源:https://stackoverflow.com/questions/45808556/incorrect-data-type-for-operator-or-function-time-date-expected-on-lotusscript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!