年份,月份和天数 [英] No of Years, Month and Days
本文介绍了年份,月份和天数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我为HR部门创建了Lotus Notes数据库.我输入了加入日期字段.还输入了总服务期限"字段.我想获得计算的服务年数,月数和天数,以查看"并每天更新服务期.
I created Lotus Notes database for HR Department. I entered field Join date. Also entered field "Total Service Period". I want get the calculated Number of Years, Month and Days of service in to "View" and to update the service period daily.
推荐答案
虽然没有对它进行全面测试,但只是出于乐趣,我想分享一下这个公式:
Didn't test this one fully, but just for the fun I wanted to share this formula:
diff:= @Adjust(endDate; -@Year(startDate); -@Month(startDate)+1;
-@Day(startDate)+1; 0; 0; 0);
y:= @Year(diff);
y:= @If(@IsError(n); 0; n>100; 0; n)
我认为可以用类似的方式计算月份和日期.
I assume months and days can be calculated in a similar way.
这篇关于年份,月份和天数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文