Date Function

  • Thread starter Thread starter Wanda
  • Start date Start date
W

Wanda

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
 
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.

--
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
 
Back
Top