The latter. And that was the approach I was just working through. 

Thanks to both you and Dave for chiming in.

--

rk

-----Original Message-----
From: ProfoxTech <profoxtech-boun...@leafe.com> On Behalf Of Ted Roche
Sent: Tuesday, May 08, 2018 9:15 AM
To: profoxt...@leafe.com
Subject: Re: Fun with date calculations in VFP

So, do you want a function that returns the second Tuesday in May or
one that returns the Tuesday closest to May 8? Both would fit the
specs.

Date math was one of my many VFP hobbies. There were lots of date math
answers in Ask Advisor.

GOMONTH() gets you to the year you want, then you can use DOW() to
figure out the day of the week that date has, then add/subtract to get
to the Tuesday you're after.


On Tue, May 8, 2018 at 9:07 AM, Richard Kaye <rk...@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

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/dm5pr10mb12445e58187567ea120d9b7fd2...@dm5pr10mb1244.namprd10.prod.outlook.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to