Skip to main content

Add Months to Date

Hello, 
Would anyone be able to tell me how to add a specified number of months to a date? I'm looking for a function that has the same functionality as Excel's EDate function. For example, if I have a date of 10/1/18 in one column, and a number of "11" in another number, I would like to append a column that will add 11 months to 10/1/18, to return 9/1/19. 
Thanks!

Brian Element Thu, 01/31/2019 - 15:08

In reply to by mkamagate

Yes there is, it is called the @WorkDay function.  You place your date within it and it will return a 0 if the date falls on a weekend or 1 if it falls on a week.  So your equation to extraction weekends would be @WorkDay(DATE_FIELD) = 0.

Brian

Steven Luciani Thu, 01/31/2019 - 14:44

Welcome mkamagate,

I just adding to this post because I want to underline the fact that there are many ways to get to the same end state using this product. The route the the final answer is normally determined by the way the logical part of your brain is wired. My solution to your problem was using the equation below in the creation of the virtual date field.

@ctod(date+"-2018","MM-DD-YYYY")

 

Same result just less typing and nesting of functions. Note that my full date field is displayed as dd/mm/yyyy as I am in Canada and my default Windows environment variables are setup to display dates this way. IDEA defaults to the Windows setup to display of dates and numbers, but you can format your dates, numbers, time and characters display by entering the column settings area of the software. A quick way to get there is by simply right clicking on any field name and choosing Column Settings... from the pick list presented to you.

Cheers,

Steven