I have a table called ElectronicDocuments with the columns DocumentName, documentModifiedOn.
I have to find the number of days the document is checked out for editing.
I am calculating the same as below:
select DATEDIFF(DAY, ED.documentModifiedOn, GETDATE()) AS [NoOfDaysFileCheckOut]
from ElectronicDocuments ED
But I am not sure whether it will show the exact count.
If the checked out time is 19July2017 13:02:02. It should show the count as 1, only when the GETDATE value is 20July2017 13:02:02.
Please help on this.