年,月和日期中2个日期之间的差异天格式 [英] Difference between 2 dates in Year, Month & Days format

查看:131
本文介绍了年,月和日期中2个日期之间的差异天格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

年,月和日的2个日期之间的差异天数格式

Difference between 2 dates in Year, Month & Days format

一栏有发行日期= 20/08/2018

One column have issue date = 20/08/2018

第二栏有结束日期= 28/03/2026

2nd column have End Date = 28/03/2026

我们要求本年度,月份和年份的本文件有效期。日期格式。 

We required period of this document in Year, month & Day format. 

推荐答案

您好Irdeepak,

Hi Irdeepak,

您可以使用以下方式达到您的要求方法

You can achieve your requirement using below method

1)为开始日期(日期和时间),结束日期(日期和时间),日期(计算列),月(计算列),年(计算列)创建一列),结果(计算栏)

1) Create a column for start date(date and time), end date(date and time), days(Calculated column), Months(Calculated column), Year(Calculated column), result(Calculated column)

然后在相应列上添加下面提到的公式

Then add the below mentioned formula on respective column

天数:  = DATEDIF(StartDates,EndDates,& ; d")

Days: =DATEDIF(StartDates,EndDates,"d")

月份:  = DATEDIF(StartDates,EndDates," m")

Months: =DATEDIF(StartDates,EndDates,"m")

年:  = DATEDIF(StartDates) ,EndDates,"y")

Years: =DATEDIF(StartDates,EndDates,"y")

结果:  = [Days]&" Days,& [Months]&" Months,&& [年]&"年"

Result: =[Days]&"Days, "&[Months]&"Months, "&[Years]&"Years"

完成所有操作后,请在开始日期和结束日期输入值来测试公式。和propbaly结果就像在屏幕下面

Once you done all things, then test the formula by entering the values in start date and end date. and propbaly the result would be like below screen

您可以使用修改视图隐藏计算的列(天,月和年),因此最终用户只能看到开始日期,结束日期和结果列..

You can hide the calculated columns (days, Months,& years) using modify view, so end user can see only start date, end date and result column..

这种方法可以帮助您始终获得准确的结果。

This approach will help you to get the exact result always.

问候:

Thivagar SEGAR

Thivagar SEGAR

____________________________________________________________________

____________________________________________________________________

如果这篇文章可以帮助您解决您的要求/问题,请将其标记为答案!!! 

If this post help you to solve your requirement/issue, please mark it as answer !!! 


这篇关于年,月和日期中2个日期之间的差异天格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆