Jul 10, 2018 04:39 PM
Hello
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’)
Jul 10, 2018 11:32 PM
In DATEADD you have separated the 2 parameters with -
, you need a comma.
Jul 11, 2018 04:49 AM
Thank you Elias it’s acting as an operator.
Date de livraison - Style délais
otherwise
21/7/18 - 20 days = 1/7/18
Jul 11, 2018 05:15 AM
DATEADD needs 3 parameters: https://support.airtable.com/hc/en-us/articles/203255215-Formula-field-reference
Jul 11, 2018 05:32 AM
Two issues:
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')
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.
Jul 11, 2018 05:34 AM
I was doing this:
Formula:
DATEADD(Date, Days, 'day')
Formula:
DATEADD(Date, -Days, 'day')
Jul 11, 2018 05:34 AM
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’)