View Single Post
  #2  
Old August 14th 08, 11:13 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default DateDiff Calculation



It's negative if date2 date1.

--
Best regards
Michael Bauer - MVP Outlook

: VBOffice Reporter for Data Analysis & Reporting
: Outlook Categories? Category Manager Is Your Tool
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Wed, 13 Aug 2008 14:49:55 -0700 (PDT) schrieb Henry Stockbridge:

Hi,

I am attempting to calculate the difference in dates between the date
an original email message was received, and the date a reply was
sent. However, this code returns negative numbers, despite the Date1,
and Date2 being in the right sequence.

Dim myItem As Object
Set myItem = Application.ActiveInspector.CurrentItem

DateDiff("d", Format(myItem.ReceivedTime, "Short Date"), Format(Now(),
"Short Date"))

Any thoughts?

Henry

Ads