Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
It must be very simple but I cannot get the result I am looking for:
How do I calculate a difference between dates?
And why this expression :
Day(Monthend(Today())) - Day(Today())
Returns nothing (error)
The expression Day(Monthend(Today())) correctly returns 31 which is an integer (for this month)
and the expression Day(Today()) correctly returns 27 which is an integer (for today 7/27/13)
But subtracting one from the other returns nothing.
I tried to convert them to numerical value Num(Day(Today()),'###') and Num(Day(Monthend(Today())) ,'###') but that did not work either.
Help?
Thanks
Hi Josh,
Not sure you try this yet:
Interval(Monthend(Today()) - Today(),'d') or Floor(Monthend(Today()) - Today())
Regards,
Sokkorn
Hi Josh,
Not sure you try this yet:
Interval(Monthend(Today()) - Today(),'d') or Floor(Monthend(Today()) - Today())
Regards,
Sokkorn
The Expression : =Day(Monthend(Today())) - Day(Today()) should work fine(working fine for me). Try that in a text object. May be you are having issue somewhere else.
Hi Josh,
The above expression will work both in Script and Text Object.
Let V1 = Today();
V2= Day(Monthend(Today())) - Day(Today())
Now V2 will result in 3.
Could you please reply more where and how you want to calculate so that we can help?
Thank you Sokkorn.
I am not sure if these are the only answers but your answers (both) returned the right result.
I must say though that after trying some more and enclosing the expression within parenthesis, it did work:
So
Day(Monthend(Today())) - Day(Today())
does not work
But
( Day(Monthend(Today())) - Day(Today()) )
does work.
Peculiar!
Once again , thank you.