Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I would appreciate some help to show me the difference between two date fields in minutes.
The date fields are in the format dd/mm/yyyy hh:mm:ss
Example:
01/01/2016 13:00:00
01/02/2016 13:00:00
Using the above example I would like to show the result 1440 minutes.
Thanks,
Daniel
Try it with: interval(Date2 - Date1, 'mm')
- Marcus
(date2 - date1) * 24 * 60
44640 minutes with DD/MM/YYYY format (about 1 month)
but I think you mean MM/DD/YYYY format, so the result is 1440 minutes (1 day = 1 * 24 * 60)
Hi Daniel,
You can use the below code in script.
T1:
LOAD * INLINE [
Date1,Date2
01/01/2016 13:00:00,01/02/2016 13:00:00
];
T2:
load Date(timestamp#(Date2,'MM/DD/YYYY hh:mm:ss'),'DD/MM/YYYY') as Dt2,
Date(timestamp#(Date1,'MM/DD/YYYY hh:mm:ss'),'DD/MM/YYYY') as Dt1,
Interval( (Date(timestamp#(Date2,'MM/DD/YYYY hh:mm:ss'),'DD/MM/YYYY')) - (Date(timestamp#(Date1,'MM/DD/YYYY hh:mm:ss'),'DD/MM/YYYY')), 'mm') as DTDiff
Resident T1;