This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I have been unable to find a post that succinctly states how to both add x number of days to today's date, or subtract x number of days from today's date. For example, I am working on a workflow that has a step to filter out records that are older than 90 days from a date column. So would the best way to accomplish this be to use a Filter Tool, and then add a formula? What should the formula be? Thanks!
I'd use DateTimeStart() as the single source of the date. It is the start of the job. Now as a caution, if you datetimetrim(DateTimeStart(),"day") you know that the time is removed. When you compare DateTime fields sometimes it matters.
Alteryx ACE & Top Community Contributor
Chaos reigns within. Repent, reflect and reboot. Order shall return. Please Subscribe to my youTube channel.
I had to figure that one out, too, only minutes ago. With the Filter tool on your sheet and selected, look in the Functions tab in the left pane for the set of "DateTime" functions. Expand the "+" symbol and click on DateTimeAdd(dt,i,u). In the one-line box below it, you'll see an example of its use.
In my case (as in yours) I needed to subtract from today's date (aka DateTimeToday()).
Suppose you want to filter your data to restrict to where the [SalesDate] field is more recent than 7 days old.
I was wondering, what if i need to add 2 or more X numbers of days to a date. I'm actually working on a workflor which calculate the terms of payments to our suppliers, those payments terms have differents number of days (example 90, 180, 60) and i need to sum those numbers of days to my date. The formula that you give us to know is perfect but only process a singular number of day like in the sample, which only process "-90"