[Remind-Fans] Calculate Time Since Calendar Date
Aric Gregson
aorchid at mac.com
Wed Jul 27 15:04:12 EDT 2011
Hello,
I am having difficulty calculating the number of days since an event. What I
have now works fine for days within the same calendar month, but it starts
to count over once the next month occurs. I would like it to count all the
days since the event, not since the beginning of the month.
Here is what I have:
FSET _da(da, mo, yr) ORD(365 * (YEAR(TRIGDATE()) - yr) + \
(MONNUM(TRIGDATE()) - mo) + \
DAY(TRIGDATE()) - da)
REM 27 jul 2011 MSG %"[_da(4, 7, 2011)] day since event%"
This works fine in July, but in August it begins to count again from the
first time the REM is issued within that month. For example:
REM 3 aug 2011 MSG %"[_da(4, 7, 2011)] day since event%" -> 0 days
REM 17 aug 2011 MSG %"[_da(4, 7, 2011)] day since event%" -> 14 days
Any suggestions on how to correctly write the FSET would be greatly
appreciated.
Thanks very much, Aric
More information about the Remind-fans
mailing list