# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On May 18th at 10AM EDT we will answer your QlikView questions live. REGISTER
cancel
Showing results for
Did you mean:
Not applicable

## get the minutes between two times

Hello!

Probably an easy one, I have two times, 08:30 and 08:40 and want to get the minutes between, 10 minutes in this case. How ca I calculate that in an expression?

Best regards

Mårten

1 Solution

Accepted Solutions
MVP

(Time2-Time1)*1440

9 Replies
MVP

(Time2-Time1)*1440

Specialist III

Use interval( A-B, 'mm' ) where A = 08:40 and B = 08:30 will return 10.

Hi,

USe interval()

like interval(time2-time1,'hh:mm')

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
MVP

Hi,

Try like this

=Interval(Timestamp#('08:40', 'hh:mm') - Timestamp#('08:30', 'hh:mm') , 'm')

To get this in script try like below

Data:

*,

Interval(Timestamp#(Time2, 'hh:mm') - Timestamp#(Time1, 'hh:mm') , 'm') AS DiffInMinutes

FROM DataSource;

Hope this helps you.

Regards,

jagan.

Specialist III

Hi

Use Interval Function:

=Interval('08:40'-'08:30','mm')&'  ' &'minutes'

Result is as follows:

Hope that helps you.

Regards

Av7eN

MVP

Hi,

Interval function is best for minute difference if the records in the same field then use Peek function to find that

Time#( TimeField,'hh:mm' ) as TimeField, Interval(TimeField - Peek('TimeField'),'mm') as Diff,

[

TimeField

08:30

08:40

];

If not then simple use

Time#(Time1,'hh:mm' ) as Time1,Time#(Time2,'hh:mm' ) as Time2,

Interval(Time2 - Time1,'mm') as Diff2;

Regards

Anand

MVP

=Interval(Time#('08:40','hh:mm')-Time#('08:30','hh:mm'),'mm')

Not applicable
Author

Thanks all!

Specialist III

Welcome!!!!!!!!!!!!!!