Sharepoint 日期时间计算列
我的列表中有 2 列 sDate (开始日期)、eDate (结束日期)。 我需要的功能
if(eDate == "" )
print sDate // Nov 10
else if(MONTH(sDate) == MONTH(eDate))
print sDate("mmm dd") + eDate(" - dd") // Nov 10 - 17
else
print sDate("mmm dd") + eDate(" - mmm dd") // Nov 10 - Dec 10
Orignal:
=IF(eDate="",TEXT(sDate,"mmm dd"),CONCATENATE(TEXT(sDate,"mmm dd")," ",(TEXT(eDate,"- dd"))))
我尝试过:
=IF(eDate="",TEXT(sDate,"mmm dd"),(IF(MONTH(sDate)=MONTH(eDate),CONCATENATE (TEXT(sDate,"mmm dd"), " ", TEXT(eDate,"- dd")),CONCATENATE (TEXT(sDate,"mmm dd"), " ", TEXT(eDate,"- mmm dd"))))
我得到这个异常,这不是很有帮助:
公式包含语法错误或不受支持。
在 Microsoft.SharePoint.Library.SPRequestInternalClass.UpdateField(字符串 bstrUrl、字符串 bstrListName、字符串 bstrXML)
在 Microsoft.SharePoint.Library.SPRequest.UpdateField(String bstrUrl, String bstrListName, String bstrXML)
I have 2 columns sDate ( Start Date ), eDate ( End Date ) in my list.
The functionality I need
if(eDate == "" )
print sDate // Nov 10
else if(MONTH(sDate) == MONTH(eDate))
print sDate("mmm dd") + eDate(" - dd") // Nov 10 - 17
else
print sDate("mmm dd") + eDate(" - mmm dd") // Nov 10 - Dec 10
Orignal:
=IF(eDate="",TEXT(sDate,"mmm dd"),CONCATENATE(TEXT(sDate,"mmm dd")," ",(TEXT(eDate,"- dd"))))
I tried:
=IF(eDate="",TEXT(sDate,"mmm dd"),(IF(MONTH(sDate)=MONTH(eDate),CONCATENATE (TEXT(sDate,"mmm dd"), " ", TEXT(eDate,"- dd")),CONCATENATE (TEXT(sDate,"mmm dd"), " ", TEXT(eDate,"- mmm dd"))))
I get this exception, which is not very helpful:
The formula contains a syntax error or is not supported.
at Microsoft.SharePoint.Library.SPRequestInternalClass.UpdateField(String bstrUrl, String bstrListName, String bstrXML)
at Microsoft.SharePoint.Library.SPRequest.UpdateField(String bstrUrl, String bstrListName, String bstrXML)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在表达式末尾添加一个右括号
)
。Excel 对于调试 SharePoint 计算列表达式非常有用 - 我已将您的表达式粘贴到 Excel 电子表格中,并将
sDate
和eDate
替换为包含示例的单元格地址日期和Excel 自动建议更正。Add one more closing parenthesis
)
at the end of the expression.Excel is useful to debug SharePoint calculated column expressions - I have pasted your expression into Excel spreadsheet, replaced
sDate
andeDate
with addresses of cells containing example dates and Excel suggested a correction automatically.