[AccessD] Date Difference As Completed Years-Months-Days

A.D. Tejpal adtp at airtelmail.in
Wed Apr 7 04:02:45 CDT 2010


Hi Gustav, Hi Stuart,

    Faced with unequal months, the results are bound to depend upon the governing  principles deemed acceptable. 

    As an illustration, let it be assumed that the elapsed period between any two dates would be reckoned as whole months (i.e. no residual days), if either of the following two conditions were met:
    (a) Day parts of both dates are equal.
    Or
    (b) Both dates represent end of the month.

    Based upon the above principles, both the following sets of dates represent an elapsed period of just one month.
    28-Jan-2003 to 28-Feb-2003 = 1 month
    31-Jan-2003 to 28-Feb-2003 = 1 month

    As a corollary, elapsed period for following sets of dates has to lie within the range represented by above two results (in other words, it has to be reckoned as just one month):
    29-Jan-2003    28-Feb-2003
    30-Jan-2003    28-Feb-2003

    This brings us back to the original question. Is it feasible to reach a consensus as to the preferred governing principles for calculating YMD elapsed between two dates ? Interested members are welcome to offer their views.

Best wishes,
A.D. Tejpal
------------

  ----- Original Message ----- 
  From: Gustav Brock 
  To: accessd at databaseadvisors.com 
  Sent: Wednesday, April 07, 2010 12:51
  Subject: Re: [AccessD] Date Difference As Completed Years-Months-Days


  Hi Stuart

  You are right. The catch is, as I have mentioned before, that "a month is not a month". This is why it makes no sense to be too specific about the difference in days.

  If you need an accurate measurement to the day, you will have to use a pure day count. Going beyond that - taking timezones and daylight saving in account - you need to count hours or even quarter hours, and even further down to take leap seconds into account.

  /gustav


  >>> stuart at lexacorp.com.pg 07-04-2010 08:37 >>>
  So four children born on four different dates are all exactly the same age ( one month old)  on 
  28 Feb 2003?

  Will they all be the same age on 1 March 2003?

  Or will one of them suddenly age by four days while another one only ages by one day?

  The real answer to "How can you calculate a date difference as completed years-months-
  days"  is "You can't!"  -  At least not consistently - since the units are not consistent multiples 
  of each other.   

  -- 
  Stuart

  On 7 Apr 2010 at 10:57, A.D. Tejpal wrote:

  > --------------------------------------------------
  > 28-Jan-2003    28-Feb-2003    1 Month
  > 29-Jan-2003    28-Feb-2003    1 Month
  > 30-Jan-2003    28-Feb-2003    1 Month
  > 31-Jan-2003    28-Feb-2003    1 Month
  > --------------------------------------------------


More information about the AccessD mailing list