Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Richard3
Contributor III
Contributor III

Add 2 days to a date

I need to add 2 days to the current date, but if we are on the 30th or 31st of the month that tells me it is the day of the following month, that is, if we are on the 31st, it brings me the date of the 2nd of the next month, is that possible?

1 Solution

Accepted Solutions
igoralcantara

I am not sure I understand completely because your description says one thing and your example says another. So, here are some alternatives:

- Same date as today, 2 years in the future:

AddYears(Today(), 2)

- Same date as today, 2 years in the past:

AddYears(Today(), -2)

- Two days after today, two years in the future:

AddYears(Today() + 2, 2)

 

Anything else you need would be a version of one of these examples.

Check out my latest posts at datavoyagers.net

View solution in original post

5 Replies
igoralcantara

If you want to add 2 days, simply do a +2

Date(Today()+2)

Check out my latest posts at datavoyagers.net
SunilChauhan
Champion II
Champion II

Write 
Date(CurrentDate+2)  as Newcolumnname in Script

 

Sunil Chauhan
Richard3
Contributor III
Contributor III
Author

Ok, thank you very much, but if I want to see two years ahead of the same date last year, that is, today is 05/15/2024, how can I get the date of 05/17/2023?

SunilChauhan
Champion II
Champion II

use 

AddYears(CurrentDate2)

Sunil Chauhan
igoralcantara

I am not sure I understand completely because your description says one thing and your example says another. So, here are some alternatives:

- Same date as today, 2 years in the future:

AddYears(Today(), 2)

- Same date as today, 2 years in the past:

AddYears(Today(), -2)

- Two days after today, two years in the future:

AddYears(Today() + 2, 2)

 

Anything else you need would be a version of one of these examples.

Check out my latest posts at datavoyagers.net