Upcoming database upgrades. to improve our reliability at 03:30 UTC on Feb. 25 / 7:30pm PT on Feb. 24. Some users may briefly experience slow load times or error messages. Learn more here


Topic Labels: Formulas
661 2
Showing results for 
Search instead for 
Did you mean: 

Hi everyone!
I have a simple DATETIME_DIFF field that returns the amount of difference in dates just fine.
I however use it to count the days of an event and would like it to return the amount of days an event takes place, which then means I would need a DATEADD +1.
For some reason I just can’t get it to work properly. It’s probably as simple as a , but still.

This is what I’m trying to build from

{End Date}=BLANK(),
'1 day',	IF(
{End Date},DATETIME_DIFF({End Date}, {Start Date}, 'days') & ' dagar '))

I am beyond greatful for any and all help I can get.

2 Replies 2

You don’t need DATEADD; since DATETIME_DIFF returns an integer you can simply add 1:

    {End Date}=BLANK(), '1 day',
        {End Date}, DATETIME_DIFF({End Date}, {Start Date}, 'days') +1 & ' dagar '

You can also simplify the formula to

    {End Date},
    DATETIME_DIFF({End Date}, {Start Date}, 'days') +1 & ' dagar ',
    '1 day'

As a side note, if you want to know how to fit DATEADD into DATETIME_DIFF:

DATETIME_DIFF(DATEADD({End Date},1,'day'),{Start Date},'days')

Thank you so much!
Thank you for simplifying the formula as well.
You answered it all with your examples and I now know for possible future use how to do it on my own.
Thank you!