7 Replies Latest reply on Oct 7, 2009 11:09 PM by 796365

    Comparing 2 dates and putting results in predetermined buckets

    800467
      Hi all

      I want to write a method which takes in as parameters 2 date objects. It works out the difference (number of years) between the 2 dates and depending on this the results are flagged against 1 of 5 buckets.

      Each bucket represents the following number of years 2, 5, 10, 20 and 30. So if my first 2 dates are taken and the number of years is 23 then the date should be stored against the 20 year bucket, or if the number of years is 6 then the date should be stored against the 5 year bucket, a value of 16 would be stored in the 20 year bucket etc...

      I was looking for suggestions on the neatest way of doing this - any suggestions would be appreciated.