Jul 08, 2024 02:25 PM
Hi!
Two formula questions -
I have (4) different date fields with timestamps and need to identify the latest date across the four fields. When doing a Max value, it does not bring in the timestamp or makes it 12:00a as a standard.
I also have (2) date fields that I need to calculate the datediff in hours and leaving the field blank if the second date field is empty instead of the NaN.
Please help! Thank you 🙂
Solved! Go to Solution.
Jul 08, 2024 08:18 PM
Try these:
DATETIME_PARSE(
MAX(
IF(
{Date 1},
VALUE(
DATETIME_FORMAT(
{Date 1},
'x'
)
),
0
),
IF(
{Date 2},
VALUE(
DATETIME_FORMAT(
{Date 2},
'x'
)
),
0
),
IF(
{Date 3},
VALUE(
DATETIME_FORMAT(
{Date 3},
'x'
)
),
0
),
IF(
{Date 4},
VALUE(
DATETIME_FORMAT(
{Date 4},
'x'
)
),
0
)
),
'x'
)
IF(
AND(
{Date 1},
{Date 2}
),
DATETIME_DIFF(
{Date 2},
{Date 1},
'hours'
)
)
Jul 08, 2024 08:18 PM
Try these:
DATETIME_PARSE(
MAX(
IF(
{Date 1},
VALUE(
DATETIME_FORMAT(
{Date 1},
'x'
)
),
0
),
IF(
{Date 2},
VALUE(
DATETIME_FORMAT(
{Date 2},
'x'
)
),
0
),
IF(
{Date 3},
VALUE(
DATETIME_FORMAT(
{Date 3},
'x'
)
),
0
),
IF(
{Date 4},
VALUE(
DATETIME_FORMAT(
{Date 4},
'x'
)
),
0
)
),
'x'
)
IF(
AND(
{Date 1},
{Date 2}
),
DATETIME_DIFF(
{Date 2},
{Date 1},
'hours'
)
)
Jul 09, 2024 05:29 AM - edited Jul 09, 2024 05:34 AM
I got the second one to work! The first is still not returning the timestamp
Jul 09, 2024 06:00 AM
What issue are you facing with it? If you could provide a read-only invite link to a duplicated copy of your base with some example data I could take a look at this for you!
Jul 15, 2024 06:51 AM
Hi! I am so sorry, was on vacation... which may have helped because I realized it wasnt working since I had time off in the formatting 🙂 Thank you SO much!!