Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Im trying to calculate the minutes between two datetime fields - but it is showing 00:00 for every record.
My calculation is :
time(
date(Timestamp(UPDATED,'DD/MM/YYYY hh:mm'),'DD/MM/YYYY hh:mm') -
date(Timestamp(CREATED,'DD/MM/YYYY hh:mm'),'DD/MM/YYYY hh:mm'),'hh:mm') AS mins_difference,
can anyone help with the correct syntax please?
Hi Phil,
Sample Data/App may help to help you.
BR,
Vijay
May be try this?
Interval(
date(Timestamp#(UPDATED,'DD/MM/YYYY hh:mm'),'DD/MM/YYYY hh:mm') -
date(Timestamp#(CREATED,'DD/MM/YYYY hh:mm'),'DD/MM/YYYY hh:mm'),'hh:mm') AS mins_difference,
minute(
interval(Timestamp(UPDATED,'DD/MM/YYYY hh:mm'),'DD/MM/YYYY hh:mm') -
Timestamp(CREATED,'DD/MM/YYYY hh:mm'),'DD/MM/YYYY hh:mm'),'hh:mm:Ss')
)
Use Interval function to calculate the date difference. Well plz check the format of both date fields it should not be string.
You can use an expression like it.
I created the inline table just for this example.
[tab1]:
LOAD
Interval( end - start, 'mm' ) AS [Minutes]
;
[tab2]:
LOAD
*
INLINE
[
start, end
'20/06/2017 13:45:00', '23/06/2017 16:00:00'
]
;