Trying to substract days from a date


I want to anticipate date based on certain selection. So when you select an option in the single select field it output a specific number of days in {Style délais} and update a date field
I’m still getting #ERROR! and without a debugging console I can’t see where is the problem

Date de livraison = date field
Style délais = integer formula field (based on a single select field)

DATETIME_PARSE(DATEADD({Date de livraison} - {Style délais}, ‘days’), ‘D MMM YYYY’)


In DATEADD you have separated the 2 parameters with -, you need a comma.


Thank you Elias it’s acting as an operator.
Date de livraison - Style délais
21/7/18 - 20 days = 1/7/18


DATEADD needs 3 parameters:


Two issues:

  1. As @Elias_Gomez_Sainz notes, DATEADD() requires three parameters. To subtract a certain number of days, you would make the second parameter negative, as so:

    DATEADD({Date de livraison}, -{Style délais}, 'days')

  2. DATEADD() returns a date, while DATETIME_PARSE() expects a string input. If you’re trying to format the date into 'D MMM YYYY' format, use DATETIME_FORMAT() instead.


I was doing this:


DATEADD(Date, Days, 'day')



DATEADD(Date, -Days, 'day')


It’s all clearer after a night sleep.
Date parsing was also useless.
Thank You Elias I strip it down to the basics and it works.
DATEADD({Date de livraison},-({Style délais}),‘d’)