Help

Re: Formatting of Dates in IF Formulas

Solved
Jump to Solution
922 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Brite_Admin
7 - App Architect
7 - App Architect

I have a formula where this year’s anniversary is based on the date of Marriage but it returns an ERROR if the marriage date is blank and I would like it show as a blank instead. Here is my old formula.

DATETIME_PARSE(
DATETIME_FORMAT(
{Marriage Date},
‘MMMM D’
)&
’ '&
YEAR(
TODAY()
),
‘MMM D YYYY’
)

II have tried using an IF statement and it does work for the blank marriage dates but for some reason, the ones with Marriage dates are no longer formatted as MMM/D/YYYY and instead show 2020-03-31T00:00:00.000Z. .
Here is my new Formula with the wrong formatting:
IF({Marriage Date},DATETIME_PARSE(
DATETIME_FORMAT(
{Marriage Date},
‘MMMM D’
)&
’ '&
YEAR(
TODAY()
),
‘MMM D YYYY’
),"")

I can’t figure out where to move the date formatting so it shows up as 3/31/2020

Any help would be appreciated.

1 Solution

Accepted Solutions
kuovonne
18 - Pluto
18 - Pluto

Remove the final part of the IF function—the final comma and the two quote characters. They are turning your date object into a date string.

IF({Marriage Date},DATETIME_PARSE(
DATETIME_FORMAT(
{Marriage Date},
'MMMM D'
)&
' '&
YEAR(
TODAY()
),
'MMM D YYYY'
))

See Solution in Thread

2 Replies 2
kuovonne
18 - Pluto
18 - Pluto

Remove the final part of the IF function—the final comma and the two quote characters. They are turning your date object into a date string.

IF({Marriage Date},DATETIME_PARSE(
DATETIME_FORMAT(
{Marriage Date},
'MMMM D'
)&
' '&
YEAR(
TODAY()
),
'MMM D YYYY'
))
Brite_Admin
7 - App Architect
7 - App Architect

Thanks kuovonne! I appreciate the help.