RE: DateAdd +weeks dropping a few days

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Last I heard 2014 is not a leap year. The calculation seems to be working
perfectly, since 52 weeks is 364 days. Try adding a year. Access can sort
out leap years if you do that.

"Robert Zeurunkl" wrote:

>
> This one actually got interesting. After a bit of research, here's what
> I found:
>
> Starting with 1/1/2005, and adding years (52 weeks at a time), I get
> the following results:
>
> 1 Week: 12/31/2005 -0 days
> 2 Weeks: 12/30/2006 -1 days
> 3 Weeks: 12/29/2007 -2 days
> 4 Weeks: 12/27/2008 -4 days
> 5 Weeks: 12/26/2009 -5 days
> 6 Weeks: 12/25/2010 -6 days
> 7 Weeks: 12/24/2011 -7 days
> 8 Weeks: 12/22/2012 -9 days
> 9 Weeks: 12/21/2013 -10 days
> 10 Weeks: 12/20/2014 -11 days
>
>
> I think what happens is that I loose one day PER YEAR because I add the
> year, but not the extra DAY to bump me over to the next year. Then you
> notice that I lose an EXTRA day in 2008 and 2012. Both leap years. SO
> leap years are partially at the root. How bout that?
>
> Finally, 2014 IS a leap year, but nothing odd happens because we don't
> get to it. My test date is january 1.
>
> In the end, I needed to take the results from DateAdd() and add one day
> for each year spanned, but also one day for each leap year encountered
> in the date range.
>
> B.
>
>
>
>
>
> Rick B Wrote:
> > I could be wrong, but this seems to work for me.
> >
> > item one (adding 52 weeks) results in the same day next year (minus 1)
> >
> > item two (adding 104 weeks) results in the same day next year (minus
> > 1),
> > then the same day the following year (minus1) Result= same day two
> > years
> > from now (minus2).
> >
> > In short, you are adding 364 days for every 52 weeks.
> >
> > 52 weeks loses one day
> > 105 weeks loses two days
> > 157 weeks loses three days
> > etc.
> >
> > I could be wrong, but this seems to make perfect sense to me.
> > Mathmatically, at least.
> >
> > Now, It is odd that adding 52 weeks results in a different date than
> > adding
> > one year. I never thought about the fact that a year is actually 52
> > weeks
> > and one day!
> >
> > Rick B
> >
>
>
> --
> Robert Zeurunkl
>
.



Relevant Pages

  • Re: DateAdd +weeks dropping a few days
    ... (no e-mails, please!) ... Both leap years. ... > Finally, 2014 IS a leap year, but nothing odd happens because we don't ... > Rick B Wrote: ...
    (microsoft.public.access.forms)
  • DateAdd +weeks dropping a few days
    ... Both leap years. ... Finally, 2014 IS a leap year, but nothing odd happens because we don't ... Rick B Wrote: ... > then the same day the following year (minus1) Result= same day two ...
    (microsoft.public.access.forms)
  • Re: DateAdd +weeks dropping a few days
    ... Robert Zeurunkl wrote: ... SO leap years are partially at the root. ... How bout that? ... Prev by Date: ...
    (microsoft.public.access.forms)
  • Re: Daveys on the road again
    ... Furballs are waiting so yeah it's a big leap forward ... The odd thing is am I scared as well. ...
    (rec.pets.cats.anecdotes)
  • Re: Help in determining age
    ... What I was supposedly thinking about was the 10-day adjustment to the calendar and the new Leap Year calculations that Pope Gregory came up with... ... Rick ... ># Name DOB Inauguration date Inauguration age ...
    (microsoft.public.excel.programming)