[thelist] vbscript/mssql calendar

Ken Schaefer Ken at adOpenStatic.com
Fri Oct 7 18:25:58 CDT 2005



: -----Original Message-----
: From: thelist-bounces at lists.evolt.org [mailto:thelist-
: bounces at lists.evolt.org] On Behalf Of Canfield, Joel
: Subject: RE: [thelist] vbscript/mssql calendar
: 
: > What are the samples you are have looked at so far? (So we
: > can judge what it
: > simple/complex in this situation)?
: 
: I guess the real issue is getting the weekday of the first day of the
: month. I'll guess VBScript knows; it seems to be pretty smart about
: dates.

>From the VBScript docs, there's a function called Weekday that returns a
numeric value indicating the day of the week for a given date. So your
supplied date would be: 01/01/2005 (replace the month/year parts but have the
day fixed as 01), and then do:

intDayOfWeek = WeekDay("01/01/2005")

There is an optional parameter "first day of week" if you wish the week to
begin on something other than Sunday (e.g. you wish your weeks to begin on
Monday).

If you want the textual representation of the weekday, then there is another
function called WeekDayName() which returns this.

See:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/htm
l/vsfctweekday.asp

If that's the only issue holding you up, then I think you're set. If you
still need assistance with other issues, please post again. I have some
calendering functions, but I'm not sure if they are overblown for what you
need... Perhaps if you can post what you have (pseudo-code is fine, and we
can nut out the rest)

Cheers
Ken



More information about the thelist mailing list