DateAdd Function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top