<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 13.11.2013 02:33, waldo kitty wrote:<br>
</div>
<blockquote cite="mid:5282D6CC.20808@windstream.net" type="cite"><br>
actually, i have in some cases... let's ask this question and see
what your charts and routines return as the result... assuming
your format is DD.MM.YYYY...
<br>
<br>
Date1 := 01.01.2000
<br>
Date2 := 01.01.2000
<br>
<br>
should be 0 (zero), right?
<br>
<br>
then
<br>
<br>
Date1 := 01.01.2000
<br>
Date2 := 02.01.2000
<br>
<br>
should be 1 (one), right?
<br>
<br>
in this case, what i (and bart, too) wrote, we're not counting the
starting day but we are counting the ending day... this rule stays
in effect throughout the entire process... my head still aches
from rummaging about doing this... it was good exercise and one i
remember being given on a test many years back to determine one's
coding level... at that time, the code was being done in dBase
II/III/IV ;)
<br>
<br>
i will have to dig deeper and see what is crossing things up for
count from 29.02.2000 to 28.02.2001... i see bart has posted a fix
which i have not yet had a chance to compare with my code or run
thru the tests i included in my posting...
<br>
<br>
the real question is this:
<br>
<br>
what do we count? the starting day, the ending day, both days or
neither day?
<br>
<br>
then we have another question:
<br>
<br>
is dayM in monthY a one month difference to dayM in monthX and
<br>
monthZ? monthX, monthY, monthZ are any three consecutive months
<br>
in linear order within one year or crossing two years
<br>
<br>
once the rules are chosen, then we have something to work with...
<br>
<br>
</blockquote>
<br>
I'm just a hobbyist, never went to university to study computer
science.<br>
<br>
We don't need to invent the wheel again, because others have
solutions for that!<br>
<br>
Perhaps its solved in "
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<span style="color: rgb(68, 68, 68); font-family: arial, sans-serif;
font-size: small; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
13.333333015441895px; orphans: auto; text-align: left;
text-indent: 0px; text-transform: none; white-space: normal;
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); display: inline !important;
float: none;">The Art of<span class="Apple-converted-space"> </span></span><em
style="font-weight: bold; font-style: normal; color: rgb(68, 68,
68); font-family: arial, sans-serif; font-size: small;
font-variant: normal; letter-spacing: normal; line-height:
13.333333015441895px; orphans: auto; text-align: left;
text-indent: 0px; text-transform: none; white-space: normal;
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);">Computer Programming</em>"
from Donald E. Knuth?<br>
<br>
I don't have such books and i don't know if i'd have the chance to
understand such a book?!!<br>
<br>
Yesterday i was running windows on this PC and tried MS Visual
Studio 2008 Help. <br>
That showed me ( -> DateDiff ) a Tutorial from a MS-India guy
that delivered code to calculate DateDiff.<br>
<br>
I'm now running Linux but perhaps i reboot later to look again?<br>
<br>
Bart delivered code that calculates 29.02.2000 to 28.02.2001 = 1
Year.<br>
And that looks reasonable to me!<br>
<br>
Bart wrote:<br>
<blockquote type="cite">
<pre wrap="">I would actually say that in this particular case the diff is 1 Year...
(11 M + (28 days in feb in a non-leapyear = 1M) = 12M = 1 Y.
Bart</pre>
</blockquote>
<br>
Soon we'll have working DateDiff function and my question will be
answered in the end!<br>
Thanks guys!!<br>
<br>
<br>
</body>
</html>