Okay
  Public Ticket #2911302
calculating dates
Closed

Comments

  • James Yang started the conversation

    I purchased wpdatatables.  What I would like to do is to calculate a future date based on a base date.  For example, if the base date is 1/31, I'd like the table to autocalculate plus 1 month, plus, 2 months etc. up to plus 6 monhts.  I'd also like the table to autocalculate base date plus 6 months minus 14 days. 

    Base date will be in column 1.  Plus 1 would be in the second column.  etc.

    Can the table created in wpdatatable do the above?  If so, how?  

    I purchased report builder.  I want the report builder to read the columns in the above table with dates and fill out a form so that the user can download the form in word.

    Is this possible?

  • James Yang replied

    1. It appears that I can add html code into a cell of a table.  Can html be used to do the date calculations?

    2. Can I insert java into the cell?

    3.  here is another possible solution.  I create a table of all dates (see attached).  it would go out for 20 years of data which is 7300 rows of data.  The table (i.e., "above table" mentioned below) which the report builder reads to fill in the variables to build the report would look up the plus 1 month, plus 2 month dates. 

    Would any of the three above be possible?

  • [deleted] replied

    Hi James

    Thank you for reaching out to us.

    Unfortunately, this can't be done out-of-the-box with the plugin. Our Formula columns can only calculate numerical data (integers and floats), but it can't calculate a date difference, nor can this be done with inserting html to a cell.

    You can, however, create an SQL query-based table, where you would use DATEDIFF() function to calculate this but I'm afraid we don't provide support for writing custom queries.