Expand my Community achievements bar.

Add a number to a date

Avatar

Level 1

How do I add 30, or a month, to a user entered date, and have it calculated in a separate field.

Example:

For the Month Ended: Jul-2010 (User entered field)

Month: Aug-2010 (For the Month Ended + 30 - calculated field)

Thanks!

1 Reply

Avatar

Former Community Member

This should do it...

// form1.page1.df2::calculate - (FormCalc, client)


if (HasValue(df1)) then

   var date_ = Date2Num(df1.formattedValue, "MM/DD/YYYY")

   date_ = date_ + 30

   $.rawValue = Num2Date(date_, "MM/DD/YYYY")

else

   $.rawValue = null

endif

Steve