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 today's date and a date field

Hi,

How do I proceed to get the difference between the dates stored in ProjectLiveDate and the current date so that the difference will be in days.

Example: If ProjectLiveDate is 3/27/2017 in M/D/YYYY format

               and today's date is 4/7/2017 in M/D/YYYY format

               the difference will be 11 days

Thanks

1 Solution

Accepted Solutions
sunny_talwar

If the dates are read as dates, you can just do this

Today(1) - ProjectLiveDate

If for some reason, QlikView doesn't understand your date, then this

Today(1) - Date#(ProjectLiveDate, 'M/D/YYYY')

View solution in original post

3 Replies
sunny_talwar

If the dates are read as dates, you can just do this

Today(1) - ProjectLiveDate

If for some reason, QlikView doesn't understand your date, then this

Today(1) - Date#(ProjectLiveDate, 'M/D/YYYY')

tresesco
MVP
MVP

And if you have time stamp for hour/min/sec, you might try with interval() like:

Interval(Today(1) - Date#(ProjectLiveDate, 'M/D/YYYY') , 'D') as DayDiff

Not applicable
Author

Thanks stalwar1‌ and tresesco‌, saw your answers now. I tried

DATEDIFF(DAY,ProjectLiveDate,GETDATE()) as LiveDate

and it worked at my end.