Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

date difference in hour and minute

hi,

i have two date fields like date1 and date2.

date1 has value 2014-08-30 05:03:16.000

date 2 has value 2014-08-30 10:02:36.000

i want to find out the difference between date2 and date1 and need the output like 4.59....

Please let me know how its done..

Thanks

Ranjith Kumaran

5 Replies
Not applicable
Author

Attached is the document. Hope it helps.

Not applicable
Author

but the output become 4.12.20.. i need it as 4.59

thanks

Ranjith Kumaran

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Suraj,

Let me suggest some changes to the solution you uploaded.

=time([date 2]-date1, 'HH:MM:SS')

The mask 'HH:MM:SS' is incorrect. It should be 'hh:mm:ss' (lower case). "MM" means "Month", which gives an incorrect result.

I believe the best function to use here is "interval()" rather than "time()". Time will give an incorrect result if the difference is greater than 24 hours. The solution I suggest is:

=interval([date 2]-date1, 'hh:mm:ss')

-Rob

Not applicable
Author

Thank you very much Rob.

MarcoWedel

QlikCommunity_Thread_132047_Pic1.JPG.jpg

hope this helps

regards

Marco