Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to calculate the following in my load script
StartDatetime - FinishDateTime
the difference should be in minutes (dates could be in the same day or few days apart)
I have tried the inerval function, it display the number of minutes but when I try to take average it does conert to small number (0.00xxx)
felmasri wrote:the above solution won't get me the minyues when the two dates I am working on are in the same day (where the time difference is less than a day)
Both approaches I mentioned work just fine for me whether the timestamps are on the same day or on different days. See below and attached. Have I misunderstood your requirement?
Edit: Ah, perhaps I confused you when I said that timestamps are stored in days. I didn't mean a whole number of days. That would be a date, not a timestamp. The time portion of a timestamp is stored as a fraction of a day. So today at noon is stored as 40323.5.
Intervals are internally stored as DAYS. If your use of numeric functions has converted it to a number, that number is the number of days. To get minutes, either multiply by 24 * 60, or convert it back to an interval and tell it to display it in minutes.
thanks for your response.
the above solution won't get me the minyues when the two dates I am working on are in the same day (where the time difference is less than a day)
Did you try Timestamp(Timestamp#(EndDateTime) - Timestamp#(StartDateTime), 'hh:mm:ss')
felmasri wrote:the above solution won't get me the minyues when the two dates I am working on are in the same day (where the time difference is less than a day)
Both approaches I mentioned work just fine for me whether the timestamps are on the same day or on different days. See below and attached. Have I misunderstood your requirement?
Edit: Ah, perhaps I confused you when I said that timestamps are stored in days. I didn't mean a whole number of days. That would be a date, not a timestamp. The time portion of a timestamp is stored as a fraction of a day. So today at noon is stored as 40323.5.
Thanks John, it works great ...thanks alot.
Hi Jhon, Iam also getting same issue, How can i retrieve the diff bn 2 date fileds in minutes. I have date format like this
Start date, End date, Start time, End time
21/05/2018, 22/05/2018, 23:55:20, 04:25:45
22/05/2018, 22/05/2018, 10:43:25, 15:55:23 ;
I want output like
Start date, End date, Start time, End time, Total_Time
21/05/2018, 22/05/2018, 23:55:20, 04:25:45, 270 Min (approximately)
22/05/2018, 22/05/2018, 10:43:25, 15:55:23