Path: csiph.com!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: "Helge Haensel" Newsgroups: comp.lang.basic.misc Subject: Re: Difference of dates in years Date: Sat, 19 May 2012 10:17:20 +0200 Organization: albasani.net Lines: 25 Message-ID: References: <5ptcr79fc5ougdtc61t8982m3tifthn5t8@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net bSmwE16bBYry7SdNb7r1sLstbbdT3oAjTwDg7qdDjQ8HHhebaaDfV3S0BBAQDhoiCyxA/s8Dp1l6TWpE2+ra4ULLlV33AkJ6wpsLJypf1fOzZ5QWaOR8iuTxYIbMmpUv NNTP-Posting-Date: Sat, 19 May 2012 08:17:25 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="S7JUxnEZOIa1sJeKtC1Ni9xtNVFiSfp+E9P+etN73CA6A6cWsvxGSuTyj2ZIkjM6C3PsaZ4YyIk8rPeTNRLXJ0Ktbu9Pk3g1MePTi9uUq//qs+JF665XbDC4Gz88ULkO"; mail-complaints-to="abuse@albasani.net" User-Agent: Opera Mail/11.64 (Win32) Cancel-Lock: sha1:WA7hg0yLOrY9Tk807sEiNdsvD6g= Xref: csiph.com comp.lang.basic.misc:277 Am 18.05.2012, 18:30 Uhr, schrieb ralph : > On Fri, 18 May 2012 17:23:34 +0200, "Helge Haensel" > wrote: > >> Hallo NG! >> I am still using VB5E under W7/64. It works within limits. >> I calculate a difference in years by: >> >> Dim j as Long, Dim OtherDate as String >> j = CLng(Date - (CDate(OtherDate))) / 365 >> >> This works so far but surely isn't correct in all cases due to Feb 29. >> Do you know a correct calculation? >> Thanks! >> > > Is DateDiff() not available in VB5E? > > -ralph Oh, thanks, I forgot that one! Helge -- Helge, DJ1WM