Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello to all.
How can I calculate the differe between two dates in minutes. The date format is of the type DD / MM / YYYY hh: mm: ss?
I tried the instruction:
interval (# timestamp (departure, 'DD / MM / YYYY hh: mm: ss') - # timestamp (arrival, 'DD / MM / YYYY hh: mm: ss'), 'hh')
but does not work
Thank you all
Time() is a formatting function, which you don't need if you format with interval():
interval ( departure -arrival, 'mm')
edit: Read more about Formatting vs. Interpretation functions:
May be like this:
Interval(TimeStamp#(departure, 'DD / MM / YYYY hh: mm: ss') - TimeStamp#(arrival, 'DD / MM / YYYY hh: mm: ss'), 'mm')
Do you have these extra spaces between DD and MM? I mean do you have this
15 / 10 / 2016 10: 38: 00
or do you have this?
15/10/2016 10:38:00
If later, then try this:
Interval(TimeStamp#(departure, 'DD/MM/YYYY hh:mm:ss') - TimeStamp#(arrival, 'DD/MM/YYYY hh:mm:ss'), 'mm')
hi Sunny.
Sorry. But do not have extra spaces between spaces between DD and MM.
thank
So did my second suggestion worked? or are you still having issues?
Yes. I tried your second suggestion, but it did not work.
Then I tried this statement:
interval (time (departure) - time (arrival), 'mm')
and it seems to work.
what do you think about it?
thank you
I think if you departure and time are already read as date, we don't need to use TimeStamp#() function. So, I think you are in good shape there
Time() is a formatting function, which you don't need if you format with interval():
interval ( departure -arrival, 'mm')
edit: Read more about Formatting vs. Interpretation functions:
Hi Marino,
May be like this,
Interval(TimeStamp(departure, 'DD / MM / YYYY hh: mm: ss') - TimeStamp(arrival, 'DD / MM / YYYYhh: mm: ss'), 'mm')