![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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 |
#2
|
|||
|
|||
![]() 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 |
#3
|
|||
|
|||
![]()
On Aug 14, 4:13*am, "Michael Bauer [MVP - Outlook]"
wrote: 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- Hide quoted text - - Show quoted text - Michael, Thanks for your response. I was probably unclear, so I will try again. Let's say someone sent me a message on 8/1/08. I store that message in my Inbox. Then, I respond to the sender in a couple days, say 8/5/08 by opening the message sent on 8/1 and hitting 'Reply.' I am trying to capture the date the original email was received (8/1) and find out how many days have elapsed since I replied to the sender. The DateDiff in this example would return 4 (8/5-8/1.) Henry |
#4
|
|||
|
|||
![]() The funtion doesn't work that way, It's not 8/5 - 8/1, but it's the difference from 8/5 to 8/1,which is negative. Simply try it, Datediff returns a negative value if Date1 Date2. -- 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 Thu, 14 Aug 2008 03:20:40 -0700 (PDT) schrieb Henry Stockbridge: On Aug 14, 4:13*am, "Michael Bauer [MVP - Outlook]" wrote: 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- Hide quoted text - - Show quoted text - Michael, Thanks for your response. I was probably unclear, so I will try again. Let's say someone sent me a message on 8/1/08. I store that message in my Inbox. Then, I respond to the sender in a couple days, say 8/5/08 by opening the message sent on 8/1 and hitting 'Reply.' I am trying to capture the date the original email was received (8/1) and find out how many days have elapsed since I replied to the sender. The DateDiff in this example would return 4 (8/5-8/1.) Henry |
#5
|
|||
|
|||
![]()
On Aug 14, 2:15*pm, "Michael Bauer [MVP - Outlook]"
wrote: The funtion doesn't work that way, It's not 8/5 - 8/1, but it's the difference *from 8/5 to 8/1,which is negative. Simply try it, Datediff returns a negative value if Date1 Date2. -- 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 Thu, 14 Aug 2008 03:20:40 -0700 (PDT) schrieb Henry Stockbridge: On Aug 14, 4:13*am, "Michael Bauer [MVP - Outlook]" wrote: 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- Hide quoted text - - Show quoted text - Michael, Thanks for your response. *I was probably unclear, so I will try again. *Let's say someone sent me a message on 8/1/08. *I store that message in my Inbox. *Then, I respond to the sender in a couple days, say 8/5/08 by opening the message sent on 8/1 and hitting 'Reply.' *I am trying to capture the date the original email was received (8/1) and find out how many days have elapsed since I replied to the sender. *The DateDiff in this example would return 4 (8/5-8/1.) Henry- Hide quoted text - - Show quoted text - Thanks, Michael. I'm all set now. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
DateDiff Validation Function | hcleb | Outlook - Using Forms | 0 | January 21st 08 07:38 PM |
File as Calculation | laura | Outlook - Using Contacts | 0 | October 4th 07 10:05 PM |