View Single Post
  #1   Report Post  
old coach old coach is offline
Junior Member
 
Posts: 14
Question compare dates using a variable

i need to know when 2 dates intersect
1-i begin with todays date and add a variable to it
2-i then subtract the same variable from a future date
3-i need to know at what date the 2 intersect

example: 7-16-2007 + 6=7-22-2007 5-10-2010 - 6=5-4-2010
then: 7-22-2007 + 6=7-28-2007 5-4-2010 - 6=4-28-2010, etc
this loop continues until they intersect.
////////////////////////////////////////////////thanks for your help so far, everyone!

John Doe's parole expires on 2/1/2008.
Each month on the 9th the parole date is reduced by 6 days.
If his parole expires before the 9th of the month, he will get 6 days on the 20th of the previous month.
When will John Doe's parole expire?
***the 6 represents a variable. It could be a 10, 12, 16 , 6****
The correct answer, calculated manually using the 6 is 12-27-2007.

Last edited by old coach : July 17th 07 at 11:52 PM Reason: actual situation