Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / August 2003

Tip: Looking for answers? Try searching our database.

Date Function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Wanda - 24 Aug 2003 19:10 GMT
I am trying to populate a date that is 4 weeks (for a
working day) prior to the Due Date on a task form.  I
created a text box and in the properties I am trying to
add the forumula to the item, but not sure how to do it.  
This is what I started with:

[Due Date] DateDiff( interval , date1 , date2 ,
firstweekday , firstweek )

Can anyone help me?   Thanks.

Wanda
Sue Mosher [MVP] - 25 Aug 2003 12:42 GMT
Wrong function. The DateDiff() function is used to determine the duration between two dates. To get a new date based on an existing date and some interval, you need to use the DateAdd() function:

   DateAdd(interval, number, date)

Hence:

   DateAdd("ww", -4, [Due Date])

or

   
   DateAdd("d", -4 * 7, [Due Date])

"ww" and "d" represent intervals of a week and a day respectively.

Signature

Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
    Microsoft Outlook Programming: Jumpstart
    for Administrators, Power Users, and Developers
    http://www.slipstick.com/books/jumpstart.htm 

> I am trying to populate a date that is 4 weeks (for a
> working day) prior to the Due Date on a task form.  I
[quoted text clipped - 8 lines]
>
> Wanda
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.