Returns a number representing the day of the week (a number from 1 to 7) given a date value.

      Weekday ( date, [firstdayofweek] )

   date            Any valid date expression.
firstdayofweek A constant that specifies the first day of the week, default=vbSunday.

The weekday() function can be used in VBA or in an SQL query. The vb constants can only be used in VBA.

To create day numbers compatible with ISO 8601 standard dates, set thefirstdayofweek to Monday(2 or vbMonday)


Dim intDay as Integer
intday = weekday("30/04/2012",2)
Wscript.Echo intDay
will return 1 (Monday)

“A committee is a thing which takes a week to do what one good man can do in an hour” ~ Elbert Hubbard


Date - Return the current date.
MonthName - Return a string representing the month.
Format - Format a Number/Date/Time.
WeekdayName - Return the day of the week.
Standard date and time notation - YYYY-MM-DD

© Copyright SS64.com 1999-2017
Some rights reserved