DateAdd Function

D

Dexter Crawford

I would like to use the Date Add Function in a database and would like to use
the weekday argument "w", which is supposed to increment the date by the
number of weekdays. However, the weekday argument gives me the same result as
the day of the year "y" argument and the day "d" argument.

Can anyone provide help on this argument? I would like have the function
skip Saturdays and Sundays when adding days.
 
A

Allen Browne

Wasn't it a double-W for weeks, i.e.:
DateAdd("ww", ...

If you are really stuck you could try:
DateAdd("d", 7 * [NumberOfWeeks], ...

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 
J

John Vinson

I would like to use the Date Add Function in a database and would like to use
the weekday argument "w", which is supposed to increment the date by the
number of weekdays. However, the weekday argument gives me the same result as
the day of the year "y" argument and the day "d" argument.

Can anyone provide help on this argument? I would like have the function
skip Saturdays and Sundays when adding days.

The Access date functions do not distinguish working days from
weekends; "w", "d" and "y" all give exactly the same result.

You will need to write or find VBA code written to deal with workdays
in order to solve this problem. The native Access functions don't cut
it.

http://www.mvps.org/access/datetime/date0012.htm has some sample code
to get you started.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Top