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

please help me calculating the days,Months and years different between 2 dates.

I have 2 fileds,start date and end date.

How can I calculates the numbers of days,months and years difference between 2 dates.

Thanks in advanvce.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

If you're OK with approximate definition of Year = 365 days, and Month = 30 days, this will work:

= div(interval(End - Start, 'D'),365) & ' Years '

& div(mod(interval(End - Start, 'D'),365),30) & ' Months '

& mod(mod(interval(End - Start, 'D'),365),30) & ' Days '

Edit: see also this thread.  The question is a little different, but maybe helpful in your case:

http://community.qlik.com/message/193057

View solution in original post

1 Reply
Anonymous
Not applicable
Author

If you're OK with approximate definition of Year = 365 days, and Month = 30 days, this will work:

= div(interval(End - Start, 'D'),365) & ' Years '

& div(mod(interval(End - Start, 'D'),365),30) & ' Months '

& mod(mod(interval(End - Start, 'D'),365),30) & ' Days '

Edit: see also this thread.  The question is a little different, but maybe helpful in your case:

http://community.qlik.com/message/193057