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

How to get no of days days between two timestamp columns

Hi

How to get no of days days between two columns

data is in below format in both columns

1899-12-31 00:00:00:0

thanks

1 Solution

Accepted Solutions
d_prashanthredd
Creator III
Creator III

Can you provide your sample data or app?

View solution in original post

15 Replies
PrashantSangle

floor(date1-date2) will give you difference in days

Regards,

Prashant

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 🙂
PrashantSangle

You can use interval()

try like

Interval(date1-date2,'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 🙂
techvarun
Specialist II
Specialist II

d_prashanthredd
Creator III
Creator III

Hi Nagamani,

I think, straight away you can do (Date2-Date1) if both the columns are having same date format.

d_prashanthredd
Creator III
Creator III

That all depends on how you want to represent the difference i.e in Days or Hours

Anonymous
Not applicable
Author

it is not giving correct values, tried as below

Anonymous
Not applicable
Author

this is gving wrong values when tried below

Interval(date1-date2,'D')

Anonymous
Not applicable
Author

when trying to do d1-d2 it is giving some abnormal value as below, can you please help on this

d_prashanthredd
Creator III
Creator III

try this..

=Ceil(Interval(Date(Date1, 'MM/DD/YYYY hh:mm:ss') - Date(Date2, 'MM/DD/YYYY hh:mm:ss'), 'DD' ))