Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
suvechha_b
Creator III
Creator III

How to get the diff betweem two date values ?

Please help me in writing the following expression :

Max((Date(Date#([Start Date],'DD/MM/YYY'),'YYYY/MM/DD'))-Min((Date(Date#([Exp End Date]),'DD/MM/YYYY'),'YYYY/MM/DD'))

Eg ,

[Start Date] : '2014-11-03 00:00:00.000'

[Exp End Date]: '2015-08-03 00:00:00.000'

Result : 273

1 Solution

Accepted Solutions
sasiparupudi1
Master III
Master III

=Max(Date#([Start Date] ,'DD/MM/YYYY'))-Min(Date#([Exp End Date],'DD/MM/YYYY'))

View solution in original post

5 Replies
sunny_talwar

Try this:

=Date#(Left('2015-08-03 00:00:00.000', 10), 'YYYY-MM-DD') - Date#(Left('2014-11-03 00:00:00.000', 10), 'YYYY-MM-DD')

suvechha_b
Creator III
Creator III
Author

Sorry .... My Date format is like this : DD/MM/YYYY

[Start Date]:03/11/2014

[Exp End Date]:03/08/2015

sasiparupudi1
Master III
Master III

=Max(Date#(SubField([Start Date],' ',1),'YYYY-MM-DD'))-Min(Date#(SubField([Exp End Date],' ',1),'YYYY-MM-DD'))

sasiparupudi1
Master III
Master III

=Max(Date#([Start Date] ,'DD/MM/YYYY'))-Min(Date#([Exp End Date],'DD/MM/YYYY'))

maxgro
MVP
MVP

if you have 2 dates fields

[Exp End Date] - [Start Date]



if you have 2 date and time and you want the difference in days

floor([Exp End Date]) - floor([Start Date])