The generic DatePart function returns an Integer containing the specified part of a given date/time value. Thus, it incorporates the functionality of the Weekday, Month, Day, Year, Hour, Minute, and Second functions. In addition, it can used to get the quarter of a given date (1 through 4) , the "Julian" date (the day of the year from 1 to 366), and the week number (1 through 53).
Syntax:
DatePart(interval, date[,firstdayofweek[, firstweekofyear]])
The DatePart function syntax has these parts:
Part | Description | |||||||||||||||||||||||||||||||||
interval | Required. String expression that is the interval of time you want to return. The string expression can be any of the following:
| |||||||||||||||||||||||||||||||||
date | Required. Date value that you want to evaluate. | |||||||||||||||||||||||||||||||||
firstdayofweek | Optional. A constant that specifies the first day of the week. If not specified, Sunday is assumed. | |||||||||||||||||||||||||||||||||
firstweekofyear | Optional. A constant that specifies the first week of the year. If not specified, the first week is assumed to be the week in which January 1 occurs. |
0 comments:
Post a Comment