#1
  1. Amateur Webdev'er
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    141
    Rep Power
    11

    How many occurences of a date, since start date


    I can't seem to wrap my head around this right now.

    The situation: Need to calculate how many 26ths of a month have transpired since November 1, 2011.

    As elementary as this sounds, I've spent an hour on this and have had to rewrite it over and over.

    Someone please bail me out. A hint? Anything, please.

    Thanks.
  2. #2
  3. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,993
    Rep Power
    9397
    Every month has a 26th so count the number of months between then and now, and +1 if today is on or after the 26th.

    Now (2012*11=22132) - then (2011*11=22121) = 12. Today is the 16th so don't add one. Thus your answer is 12.

    Comments on this post

    • xpatriot agrees : Bailout
  4. #3
  5. Amateur Webdev'er
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    141
    Rep Power
    11
    Thanks.

IMN logo majestic logo threadwatch logo seochat tools logo