Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Subtract Number Value from Date

Hello!

 

I am working in the query editor and looking to have a custom column as specified below ...

 

Date# Days (Whole number data type)NEW CUSTOM COLUMN
1/10/202011/9/2020
1/10/202021/8/2020
1/10/202031/7/2020

 

As you can see in my example table, I would like to subtract the number of days from the # Days column from the date column to output the new custom column. I am looking for code that translates that whole number into a days format so it can be properly subtracted.

 

I would appreciate any help! Thank you in advance!

  • Hi Anonymous ,

     

    Try this:

     

    Did I answer your question? Mark my post as a solution!
    Ricardo

     

5 Replies

  • camargos88's avatar
    camargos88
    Community Champion

    Hi Anonymous ,

     

    Try this:

     

    Did I answer your question? Mark my post as a solution!
    Ricardo

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Amazing! Thank you very much!

      • camargos88's avatar
        camargos88
        Community Champion

        Hi Anonymous ,

         

        Nice you got it done!

         

        Did I answer your question? Mark my post as a solution!
        Ricardo

  • djmini's avatar
    djmini
    Frequent Visitor

    As an alternative to the above, setting the 'data type' of the column holding the number of days to 'Duration' allows it to be used in a Custom Column, with a simple Date column + or - Duration Column formula.