Welcome @joneill!
The datetime_diff formula substracts between two date times, so the format you are using it in will not evaluate the way you are looking for in the equation.
Try something like this-
IF(
DATETIME_FORMAT({Role Start Date},'D')<15,
DATETIME_FORMAT({Role Start Date}, 'YYYY-MM'),
DATETIME_FORMAT(DATEADD({Role Start Date}, 1,'month'), 'YYYY-MM')
)
I don't think you really need the nested if statement because you are basically stating that if it is less than 15 days do this, for everything else, days greater than 15, do this other thing.
All the best!
Welcome @joneill!
The datetime_diff formula substracts between two date times, so the format you are using it in will not evaluate the way you are looking for in the equation.
Try something like this-
IF(
DATETIME_FORMAT({Role Start Date},'D')<15,
DATETIME_FORMAT({Role Start Date}, 'YYYY-MM'),
DATETIME_FORMAT(DATEADD({Role Start Date}, 1,'month'), 'YYYY-MM')
)
I don't think you really need the nested if statement because you are basically stating that if it is less than 15 days do this, for everything else, days greater than 15, do this other thing.
All the best!
Thank you Brian, Greatly appreciated!
I tried it without the nested IF statement prior to posting but it didn't work, possibly because of the two different date adds.
Your solution above works perfectly.
Thanks Again.