Forum Discussion
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/2020 | 1 | 1/9/2020 |
| 1/10/2020 | 2 | 1/8/2020 |
| 1/10/2020 | 3 | 1/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
- camargos88Community Champion
Hi Anonymous ,
Try this:
Did I answer your question? Mark my post as a solution!
Ricardo- AnonymousNot applicable
Amazing! Thank you very much!
- camargos88Community Champion
Hi Anonymous ,
Nice you got it done!
Did I answer your question? Mark my post as a solution!
Ricardo
- djminiFrequent 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.
- mwhoskissonNew Member
This worked for me and is very simple. Thanks!