Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

Datetime_Parse with calculated Dates

Topic Labels: Formulas
Solved
Jump to Solution
1316 2
cancel
Showing results for 
Search instead for 
Did you mean: 
oreocereus
7 - App Architect
7 - App Architect

Quick one, I use date_add to calcuate a bunch of dates in different field. Now, I'm realising that even tho I use "Datetime_Format" airtable can't easily interpret those as dates if I want to sort by them or make timelines etc.

Here is an example of a date formula I use.

IF({Target 1st Harvest Date}=BLANK(),
IF(
  AND(
    IS_AFTER({Target Sowing Date}, '10/01/2023'), 
    IS_BEFORE({Target Sowing Date}, '04/01/2024')
    ),
  (DATETIME_FORMAT((DATEADD({Target Sowing Date}, (1*{WtH}), 'weeks')),'DD MMM YY')),
  (DATETIME_FORMAT((DATEADD({Target Sowing Date}, (1.5*{WtH}), 'weeks')),'DD MMM YY')))
  
,(DATETIME_FORMAT({Target 1st Harvest Date}, 'DD MMM YY')))
 
Here's another
 
DATETIME_FORMAT(
  (DATEADD({Target Crop Out Date}, (0+{Termination Wks}), 'weeks')
    ),'DD MMM YY')

Now, as I need to sort by these for various views, use them in timelines, etc, I end up making a new field called "[date field] PARSED" which is just using the "Datetime_parse({CALCULATED DATEFIELD})." Is there a way to simplify this so I don't need 2 fields displaying the same date? I tried replacing the "datetime_format" wrapping on these with "Datetime_Parse" to no avail. I sort of understand that on the "IF" statement formulas, that it may not work, but I would've thought the latter formula could easily handle the datetime_parse formula.

I am trying to clean up bases as there are a LOT of fields in some of these that make it hard for new users, and even myself when it comes to tinkering the design.


1 Solution

Accepted Solutions
Sho
11 - Venus
11 - Venus

If you only want to output dates, you do not need Datetime_format.
Formula and rollup fields can be formatted if the output is a date type.

2023-08-12 094328.png

Datetime_format is a function that returns a string type and is used to insert a date into a string.

See Solution in Thread

2 Replies 2
Sho
11 - Venus
11 - Venus

If you only want to output dates, you do not need Datetime_format.
Formula and rollup fields can be formatted if the output is a date type.

2023-08-12 094328.png

Datetime_format is a function that returns a string type and is used to insert a date into a string.

Golly, I do feel silly!!