Return the year part of the specified date:
SELECT DatePart("yyyy", #09/05/2017#);
Try it Yourself »
The DatePart() function returns a specified part of a date, as an integer.
DatePart(
datepart,
date,
firstdayofweek,
firstweekofyear)
Parameter | Description |
---|---|
datepart | Required. The date part to return. Can be one of the following values:
|
date | Required. The date value to be evaluated |
firstdayofweek | Optional. Specifies the first day of the week. Can be one of the following values:
|
firstdayofyear | Optional. Specifies the first week of the year. Can be one of the following values:
|
Works in: | From Access 2000 |
---|
Return the month part of the specified date:
SELECT DatePart("m", #09/05/2017#);
Try it Yourself »
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!