RE: Fun with date calculations in VFP

Author: Richard Kaye

Posted: 2018-05-08 at 08:27:16

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-bounces@leafe.com> On Behalf Of Ted Roche

Sent: Tuesday, May 08, 2018 9:15 AM

To: profoxtech@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 <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.

©2018 Richard Kaye