Sharepoint、计算列、IF 函数和日期
我正在尝试添加一个计算列。
我有一个日期列,其中包含安排会议的日期。在本专栏中,我需要一个代码,如果会议安排在第一季度、第二季度、第三季度或第四季度,则可以返回该代码。我有一个如下所示的静态代码:
'=IF(Date<40269;"Q1";"Q2-4")' (40269 is the 1. April 2010 and Date=date-column)
但我需要某种动态代码,它可以在明年计算相同的结果,而无需有人更改数字(40269)。我需要这样的东西:
'=IF(Date<01-01-&year(today);"Q1";IF(Date<01-04-&year(today);"Q2";IF(Date<01-07-&year(today);"Q3";"Q4")))'
但是Sharepoint不会接受像这样写的日期01-01-2010,它需要是一个数字,例如。 40269. 上面的代码仅适用于当前年份,但这没关系,因为我只会使用当前年份的数据。
有人可以帮助我吗?
I am trying to add a calculated column.
I have a date column containing the date a meeting is scheduled. From this column I need a code which can return if the meeting is scheduled in Q1, Q2, Q3 or Q4. I have a static code looking like this:
'=IF(Date<40269;"Q1";"Q2-4")' (40269 is the 1. April 2010 and Date=date-column)
But I need somekind of dynamic code which can calculate the same thing next year as well, without someone having to change the number(40269). I need something like this:
'=IF(Date<01-01-&year(today);"Q1";IF(Date<01-04-&year(today);"Q2";IF(Date<01-07-&year(today);"Q3";"Q4")))'
But Sharepoint will not accept a date written like this 01-01-2010, it needs to be a number eg. 40269. The above code will only work correct for the present year, but thats all-right, since I will only use data from the present year.
Can anyone help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
啊啊……比我预想的要容易。我使用了这个函数:
日期是包含会议日期的列。
month()
返回月份的数字。例如,行军=3。Ahhhh... It was easier than I had anticipated. I used this function:
Date is a column containing the date of the meetings.
month()
returns the number of the month. E.g., march=3.