VBScript DatePart Function
Complete VBScript Reference
The DatePart function returns the specified part of a given date.
Syntax
|
DatePart(interval,date[,firstdayofweek[,firstweekofyear]])
|
| Parameter |
Description |
| interval |
Required. The interval of time to return. Can take the
following values:
- yyyy - Year
- q - Quarter
- m - Month
- y - Day of year
- d - Day
- w - Weekday
- ww - Week of year
- h - Hour
- n - Minute
- s - Second
|
| date |
Required. Date expression to evaluate |
| firstdayofweek |
Optional. Specifies the day of the week. Can take the
following values:
- 0 = vbUseSystemDayOfWeek - Use National Language Support (NLS) API
setting
- 1 = vbSunday - Sunday (default)
- 2 = vbMonday - Monday
- 3 = vbTuesday - Tuesday
- 4 = vbWednesday - Wednesday
- 5 = vbThursday - Thursday
- 6 = vbFriday - Friday
- 7 = vbSaturday - Saturday
|
| firstweekofyear |
Optional. Specifies the first week of the year. Can
take the following values:
- 0 = vbUseSystem - Use National Language Support (NLS) API setting
- 1 = vbFirstJan1 - Start with the week in which January 1 occurs
(default)
- 2 = vbFirstFourDays - Start with the week that has at least four days
in the new year
- 3 = vbFirstFullWeek - Start with the first full week of the new year
|
Complete VBScript Reference

Need an easy way to get data into XML, or transform XML to another format?
MapForce lets you map XML data to/from any combination of XML, database, flat file, Excel 2007, XBRL, or Web services data.
Then it transforms data instantly or auto-generates royalty-free data integration code for recurrent conversions.
New features in Version 2010!
Download a free, fully functional 30-day trial to experience the following features:
- Easy-to-use, graphical data mapping interface
- Instant data transformation
- XSLT 1.0/2.0 and XQuery code generation
- Java, C#, and C++ code generation
- Advanced data processing functions
- Support for all major relational databases including SQL Server, IBM DB2, Oracle, and more
- Visual Studio & Eclipse integration
Download a fully-functional trial today!
|
|
|
|