Difference between revisions of "Displaying Difference between Two dates in Hours in Reports"
From SmartWiki
Line 1: | Line 1: | ||
To calculate difference between two dates in hours in the Reports, we can use the following syntax: | To calculate difference between two dates in hours in the Reports, we can use the following syntax: | ||
− | 24*(To_days(enddate)-To_days(startdate))+(hour(enddate)-hour(startdate))+((minute(enddate)-minute(startdate))/60) where the enddate and startdate may be replaced by column numbers. For example, if the Startdate is displayed in column 1 and Enddate is displayed in column 2 then the syntax would be: | + | <pre style="white-space: pre-wrap; |
+ | white-space: -moz-pre-wrap; | ||
+ | white-space: -pre-wrap; | ||
+ | white-space: -o-pre-wrap; | ||
+ | word-wrap: break-word;">24*(To_days(enddate)-To_days(startdate))+(hour(enddate)-hour(startdate))+((minute(enddate)-minute(startdate))/60) </pre> | ||
+ | '''where''' the enddate and startdate may be replaced by column numbers. For example, if the Startdate is displayed in column 1 and Enddate is displayed in column 2 then the syntax would be: | ||
− | 24*(To_days([2])-To_days([1]))+(hour([2])-hour([1]))+((minute([2])-minute([1]))/60) | + | <pre style="white-space: pre-wrap; |
+ | white-space: -moz-pre-wrap; | ||
+ | white-space: -pre-wrap; | ||
+ | white-space: -o-pre-wrap; | ||
+ | word-wrap: break-word;">24*(To_days([2])-To_days([1]))+(hour([2])-hour([1]))+((minute([2])-minute([1]))/60)</pre> | ||
==See Also== | ==See Also== |
Latest revision as of 10:09, 19 November 2013
To calculate difference between two dates in hours in the Reports, we can use the following syntax:
24*(To_days(enddate)-To_days(startdate))+(hour(enddate)-hour(startdate))+((minute(enddate)-minute(startdate))/60)
where the enddate and startdate may be replaced by column numbers. For example, if the Startdate is displayed in column 1 and Enddate is displayed in column 2 then the syntax would be:
24*(To_days([2])-To_days([1]))+(hour([2])-hour([1]))+((minute([2])-minute([1]))/60)