Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Difference between dates from different month

Hi all

I have a question that maybe you know the answer. I have to substract two different dates but each of those belongs to different months. For example this code equivalent to this code in c#


DateTime dt1 = new DateTime(2012, 05, 07);  //YYYY/MM/DD

DateTime dt2 = new DateTime(2012, 03, 06);

int days = (dt2 - dt1).Days; // 62 days

Somebody know the trick?

Thanks in advance

1 Solution

Accepted Solutions
Not applicable
Author

Try using the Interval function - Interval(DateTime1 - DateTime2). Just be aware that it is a date and time interval so for just days difference.

View solution in original post

2 Replies
Not applicable
Author

Try using the Interval function - Interval(DateTime1 - DateTime2). Just be aware that it is a date and time interval so for just days difference.

chematos
Specialist II
Specialist II

Hi,

I,ve tried creating a variable with makedate(2012,02,02) and the result of Today()-$(vDate) is 97.

You must be sure that the type of the dates is the same for both of them and it must work.

Regards