Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

difference between 2 dates in days/hrs/mins

Hi,

I am trying to calculate the difference between 2 variables

variables...

vMinDate

vMaxDate

these variables are only dates, so i need to also include the time.so...

vMinDate needs to use the function daystart to make it a timestamp

vMaxDate needs to use the function dayend

example..

vMinDate = '01/06/2013' daystart would make it '01/06/2013 00:00:00'

vMaxDate = '02/06/2013' dayend would make it '02/06/2013 23:59:59

so the duration i need is

1 day 23 hrs 59mins

or it would be perfect to round it up to 2 days.

Is this possible?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

something like this

round(interval(dayend(date#(vMaxDate,'DD/MM/YYYY'))-date#(vMinDate,'DD/MM/YYYY'),'D hh:mm'))


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

something like this

round(interval(dayend(date#(vMaxDate,'DD/MM/YYYY'))-date#(vMinDate,'DD/MM/YYYY'),'D hh:mm'))


talk is cheap, supply exceeds demand
hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

fantastic, thanks Gysbert