Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

days between two dates

hi all ,

i have dates below ,

i would like to find the no of days between these dates

01/15/2014 and 02/20/2014 (these dates are in MM/DD/YYYY format)

Thanks in Advance

1 Solution

Accepted Solutions
PrashantSangle

Hi,

Try below two

1)

Interval(Date(Date#(first_date,'MM/DD/YYYY'))-Date(Date#(secondDate,'MM/DD/YYYY')),'D')

2)

Num(Date#(first_date,'MM/DD/YYYY'))-Num(Date#(secondDate,'MM/DD/YYYY'))

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

9 Replies
PrashantSangle

Hi,

Use Interval(first_date-secondDate,'D')

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Anonymous
Not applicable
Author

Hi max ,

Thanks for ur reply , its not working

Thanks

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

Try

= Date('05/01/2014','MM/DD/YYYY') - Date('02/10/2014','MM/DD/YYYY')

= Date(DateField,'MM/DD/YYYY') - Date(DateField,'MM/DD/YYYY')

i.e End date - Start date


maxgro
MVP
MVP

=Date#('02/20/2014', 'MM/DD/YYYY') - date#('01/15/2014', 'MM/DD/YYYY')

Anonymous
Not applicable
Author

What do you mean by "it's not working"?  Have to be more specific.

It is working - see attached.

PrashantSangle

Hi,

Try below two

1)

Interval(Date(Date#(first_date,'MM/DD/YYYY'))-Date(Date#(secondDate,'MM/DD/YYYY')),'D')

2)

Num(Date#(first_date,'MM/DD/YYYY'))-Num(Date#(secondDate,'MM/DD/YYYY'))

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Anonymous
Not applicable
Author

See the link for same problem

http://community.qlik.com/message/733210#733210

Thanks

BKC

Anonymous
Not applicable
Author

2nd expression is working fine .A very thanks  for your solution

fabs(Num(Date#(first_date,'MM/DD/YYYY'))-Num(Date#(secondDate,'MM/DD/YYYY')))


Thanks

jonathandienst
Partner - Champion III
Partner - Champion III

Please all pay attention to the correct usage of Date() and Date#() and Interval() and Interval#()

Get the Dates Right

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein