Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
im trying to calculate the number of hours between two dates and Im getting a 00 value.
This is my expression :
Interval( Timestamp(Date + Start,'DD/MM/YYYY hh:mm') - Timestamp(Date + Start,'DD/MM/YYYY hh:mm'), 'hh' ) as Difference,
can anyone help please?
Phil
zero hours returned looks right, since you are subtracting (Date+Start) - (Date+Start) and this is zero by definition.
By the way, no need to format your values using Timestamp() inside the Interval() function.
You can use an expression like it.
I created the inline table just for this example.
[tab1]:
LOAD
Interval( end - start, 'hh:mm' ) AS [Hours]
;
[tab2]:
LOAD
*
INLINE
[
start, end
'20/06/2017 13:45:00', '23/06/2017 16:00:00'
]
;