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: 
Not applicable

Difference Between Dates as number of days

Hi guys,

I am trying to get the difference between two dates.

'22/04/2010' - '20/04/2010' AS [Diff1], // This on works, and I get result = 2

The field [OtdDueDate] has the same value ==> 22/04/2010

When trying the following: [OtdDueDate] - '20/04/2010' AS [Diff2], // I get result = 0

I also tried converting the field to date: Date([OtdDueDate]) - '20/04/2010' AS [Diff3] // I get result = 0

I've tried converting both arguments to dates: Date([OtdDueDate]) - Date('20/04/2010') AS [Diff4]

How can I work it around?

Thanks in advance,

Aldo.



1 Solution

Accepted Solutions
Not applicable
Author

try this

date(date#([otdduedate],'specify which format the otdduedate date is'),'MM/DD/YYYY') -

date('20/04/2010','MM/DD/YYYY')

-Raghu

View solution in original post

2 Replies
Not applicable
Author

try this

date(date#([otdduedate],'specify which format the otdduedate date is'),'MM/DD/YYYY') -

date('20/04/2010','MM/DD/YYYY')

-Raghu

Not applicable
Author

Thanks,

Aldo.