Sep 21, 2016 11:16 PM
I want to put the result of another field in place of [#] in the formula: DATEADD([date], [#], ‘units’)
I’ve tried enclosing the field name in [] {} () but nothing seems to work.
Am I missing something?
Sep 22, 2016 12:26 AM
Usually you don’t need 'm (only use when there are {spaces your field name}). And when you use the formula editor it will fix that for you. Simply pick the field from below and narrow it down by typing the first character(s) from the name.
Also, it shows examples in the editor. :slightly_smiling_face:
Sep 22, 2016 12:34 AM
Thanks Tuur, I probably should have been more complete in my description: As well as trying [], {} and (), I tried it with just the field name, but to no avail. The only time this formula worked was if I inserted a specific number for [#]
I’ve had success using variables in other formula, just not this one:
DATEADD([date], [#], ‘units’)
Sep 22, 2016 01:34 AM
Ah. In that case it could be a specific date related conversion thingy. :slightly_smiling_face:
I’ll have a closer look at it later…
Sep 22, 2016 06:17 AM
No probs here when I use…
DATEADD(Datefield, Numberfield, 'day')
Sep 22, 2016 11:08 AM
Thanks for testing this Tuur - I also keep trying but this formula field only returns the same date as the [Datefield] with an additional (unwanted) time stamp of 12:00am.
https://airtable.com/shrX2oVgmvKcDyXfE
The formula in NextDateDue field reads: DATEADD(JobDate, Frequency, ‘day’)
:slightly_smiling_face: It’s going to be fun when we get to the bottom of this one :slightly_smiling_face:
Sep 22, 2016 11:21 AM
What happens when you change the format of {frequency} to drop the decimal point & zero?
Sep 22, 2016 11:27 AM
Oh. Now I see that the field is not a number field. As lookups are handled differently (as arrays) that could be the problem. :slight_frown:
Sep 22, 2016 11:28 AM
Yes, apparently the DATEADD formula will not accept a number from a Lookup or a Formula ONLY a Number field :frowning:
This is unfortunate, as the number I am wanting to reference is from another table. The only way around this is likely to involve copying from the lookup and pasting into a number field for every new record.
Sep 22, 2016 11:29 AM
And what happens when you use the {freq} field?