Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
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
Partner - Specialist
Partner - Specialist

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
Partner - Specialist
Partner - Specialist

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
Partner - Specialist
Partner - Specialist

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