
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Subtract from date time field using Interval
Here is my scenario. I'm trying to subtract 7 days from a date time field.
Example: MyField : 15/12/2019 05:00 -> (dd/mm/yyyy hh:mm).
The result I'm expecting is : 08/12/2019 05:00 > (dd/mm/yyyy hh:mm).
When I remove the hour from MyField it works well . I use the interval function to do the job:
Date(interval([DATA] - 7,'D'),'DD/MM/YYYY'). The result is 08/12/2019 .
When I try something like this it doesn't work:
Date(interval([DataHra] - 7,'D'),'DD/MM/YYYY hh:mm').
Thanks in advance.
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@rafaelsch you can test for example :
=Timestamp(interval(Timestamp#(YOURFIELD,'dd/mm/yyyy hh:mm')-7,'D'))
for example :
=Timestamp(interval(Timestamp#('15/12/2019 05:00','dd/mm/yyyy hh:mm')-7,'D'))
the output is :
SET DateFormat='dd/mm/yyyy';
SET TimestampFormat='dd/mm/yyyy hh:mm]';
Taoufiq ZARRA
"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "
(you can mark up to 3 "solutions") 😉

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@rafaelsch you can test for example :
=Timestamp(interval(Timestamp#(YOURFIELD,'dd/mm/yyyy hh:mm')-7,'D'))
for example :
=Timestamp(interval(Timestamp#('15/12/2019 05:00','dd/mm/yyyy hh:mm')-7,'D'))
the output is :
SET DateFormat='dd/mm/yyyy';
SET TimestampFormat='dd/mm/yyyy hh:mm]';
Taoufiq ZARRA
"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "
(you can mark up to 3 "solutions") 😉

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@rafaelsch set the timestamp format as below based on your source data values.
SET TimestampFormat='DD/MM/YYYY hh:mm'
Then you can simply use below and you can also provide the format of your choice
=timestamp(DATE_FIELD-7,'DD/MM/YYYY hh:mm')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It worked. Thanks a lot!
