Sharepoint - 结束日期减去开始日期 = 年?
我需要计算两个字段之间的年数;
场A 开始日期(日/月/年)
字段 B 结束日期(日/月/年)
字段 C 计算公式显示字段 A 和 B 之间的年和月差异,即 5.2
谢谢大家。
I am needing to calculate the number of years between two fields;
Field A
Start Date (dd/mm/yyyy)
Field B
End Date (dd/mm/yyyy)
Field C
Calc formula display difference between Field A and B in years and months i.e 5.2
Thanks all.
假设您要询问计算列,那么您需要 DATEDIF 函数
另外我假设 5.2 是 5 年零 2 个月——而不是 5 年又 0.2 年——在你的问题中更具体一点,你会得到更好的答案。
常见公式示例
Assuming you are asking about Calculated Columns then you need the DATEDIF function
Also I am assuming that the 5.2 is 5 years and 2 months - not 5 years and .2 of a year - be a bit more specific in your question and you will get better answers.
So
Examples of common formulas