[thelist] vbscript: dateadd weekdays

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


Hi

"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 :-)
http://groups.google.com.au/group/microsoft.public.scripting.wsh/browse_frm/t
hread/86b0c04dfa8c6340/948913f6bf6f086e?lnk=st&q=VBScript+DateAdd+Day+Weekday
+difference+group%3Amicrosoft.public.*&rnum=1&hl=en#948913f6bf6f086e
-or-

http://tinyurl.com/rrn3s

Cheers
Ken

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