We have a SharePoint 2013 list column 'Expiry Date' and we need to calculate overdue by days. For eg, if expiry date is 1/8/2017 and Overdue by days should be 158. How to achieve this? thanks in advance!
Asked
Active
Viewed 6,782 times
2 Answers
1
Try to add this formula to your calculated field to show diff between two dates as days.
=DATEDIF([Current Date], [Enddate],"d")
Note : [Today] does not work in calculated field as explained here: How to use Today and Me in Calculated column
Mohamed El-Qassas MVP
- 45,382
- 9
- 53
- 96
-
I am also here if you need any clarification – Mohamed El-Qassas MVP Aug 04 '16 at 08:08
-
Good reference to here But your temporarily DateTime column has the exact same issue It will not update unless the Item is updated or the Field definition is updated So if you do nothing and wait 24 hours.. the DateTime value is yesterday – Danny '365CSI' Engelman Aug 04 '16 at 08:15
-
Dear @Danny I agree with you but I tried to answer based on the question requirement but there's more solution regarding that but depend on the questioner experience so I typed I am also here if you need any clarification at every answer , have good day danny :) – Mohamed El-Qassas MVP Aug 04 '16 at 08:24
-
Your DATEDIF answer is 100% correct, your suggested workaround does not work for the same reason why [TODAY] does not work. – Danny '365CSI' Engelman Aug 04 '16 at 08:38
-
I have already mentioned this in Note : section, also I see someone suggest the same workaround based on MSDN Microsoft at last section https://blogs.msdn.microsoft.com/cjohnson/2006/03/15/sharepoint-today-field-and-calculated-fields/ anyway we only have the same aim to help the questioner and really i appreciate your comments :) – Mohamed El-Qassas MVP Aug 04 '16 at 08:49
-
You are not helping OP referencing blogs from 2006 that are outdated and just plain wrong... – Danny '365CSI' Engelman Aug 04 '16 at 15:49
0
You can add jslink on the view. Inside JS link, calculate the number of days from today to get the required value. As JSlink executes on page load, it will always show updated value based on today.
Monica Jagani
- 3,836
- 6
- 32
- 49