I found a millisecond approach a while back that hasn't given us any issues yet
604800000 milliseconds in a week is the fact I base the code on.
var date:Date = new Date(YYYY, MM, DD);
Datetime lastyear = date.setMilliseconds(date.milliseconds - 604800000 * 52);
On Tue, May 8, 2018 at 8:07 AM, Richard Kaye rkaye@invaluable.com wrote:
While doing my due diligence on the subject I thought I’d toss it out here in case someone already has a function handy that will do this, thus saving me the effort of thinking too hard too early in the day. 😉
Here’s the goal. I want to take a date, say today, Tuesday May 8, 2018 and figure out how to return Tuesday, May 9, 2017 or Tuesday May 10, 2016, etc. This is so I can do some year over year comparisons to transactions that occurred on the same day of the week a year ago.
TIA
--
rk
[excessive quoting removed by server]