FUNCTION: DatePart( )
Implemented in version 2.0
function returns the designated part of the date.
There are two mandatory arguments.
argument designates the the type of time interval.
Only the following settings may be used. You must place the setting inside a pair of double quotes.
Day Of Year
Week Of Year
argument is the date and time you designate.
<% =Date %>
<% =DatePart("D", Date) %>
The weekday is given as a number from the Date And Time CONSTANTS which are listed below. In the example, 7 equals Saturday.
<% =DatePart("W", 1/1/2000) %>
There are two optional arguments.
argument must only use the constants or values defined below in the Date And Time CONSTANTS.
Week of January 1
First week of the year thathas at least four days
First full week of the year
Use the date format of the computer's regionsl settings
Use the first full day of the week as defined by the system settings
In this example, Tuesday is defined to be the first day of the week. Therefore, Saturday becomes the 5th day of the week.
<% =DatePart("W", "1/1/2000", 3) %>
<% =DatePart("W", "1/1/2000", VBTUESDAY) %>
argument must only use the constants or values defined in the Date And Time CONSTANTS which are listed above.
This example returns how many full 7 day weeks there were in 1999.
<% =DatePart("WW", "12/31/1999", 1, VBFIRSTFULLWeek) %>
Copyright 1999-2004 by Infinite Software Solutions, Inc. All rights reserved.