Hi!
I am working on a contract template, where one of the dynamic fields pulled from AT is the duration of the contract, expressed in the following manner:
The initial term of this Agreement shall be for a period of 2 months and 5 days, commencing on…
I have a basic formula that allows me to extract an amount of time as a single term (1 month), but it’s not smart enough to say something like 1 month and 5 days. Basically, I don’t know how to add the remaining days. Here is my current formula:
IF(
{End Date & Time}="",
"",
IF(
DATETIME_DIFF(
{End Date & Time},
{Start Date & Time},
'months'
)=1,
DATETIME_DIFF(
{End Date & Time},
{Start Date & Time},
'months'
) & " month",
IF(
DATETIME_DIFF(
{End Date & Time},
{Start Date & Time},
'months'
)=0,
IF(
DATETIME_DIFF(
{End Date & Time},
{Start Date & Time},
'days'
)=0,
DATETIME_DIFF(
{End Date & Time},
{Start Date & Time},
'hours'
) &" hours",
DATETIME_DIFF(
{End Date & Time},
{Start Date & Time},
'days'
) &" days"
),
DATETIME_DIFF(
{End Date & Time},
{Start Date & Time},
'months'
) &" months"
)
)
)
Let me know if this doesn’t make sense, thanks!
Sean