[thelist] vbscript: dateadd weekdays

Ken Schaefer Ken at adOpenStatic.com
Thu Apr 6 20:05:38 CDT 2006


"d" and "w" behave the same way (as you have discovered). Using "w" does not
exclude weekends. The documentation isn't clear about the differences between
"d" and "w" (because there aren't any), but nowhere does it say that "w"
applies to working days only. If you look at the Weekday() function, you'll
see it can be used to determine any day of the week (Saturdays and Sundays
included), which implies that weekdays are any day of the week. But why have
both "d" and "w" then?

This post might help answer that question, kind of :-)



My IIS Blog: www.adOpenStatic.com/cs/blogs/ken
Tech.Ed Boston 2006 - see you there: Everything the web administrator needs
to know about MOM 2005

: -----Original Message-----
: From: thelist-bounces at lists.evolt.org [mailto:thelist-
: bounces at lists.evolt.org] On Behalf Of Canfield, Joel
: Subject: [thelist] vbscript: dateadd weekdays
: Why does this
:   <%
:   response.write(dateadd("w",28,date) & "<br />")
:   response.write(dateadd("d",28,date) & "<br />")
:   %>
: return this
:   5/4/2006
:   5/4/2006
: instead of the first being about eight days later to account for the
: weekends not being counted? am I misunderstanding what 'weekdays' are
: in
: vbscript?
: thanks
: spinhead

More information about the thelist mailing list