MS Access DateAdd()関数
例
指定した日付に2年を追加します。
SELECT DateAdd("yyyy", 2, #22/11/2017#);
定義と使用法
DateAdd()関数は、日付に時間/日付間隔を追加してから、日付を返します。
構文
DateAdd(interval, number, date)
パラメータ値
Parameter | Description |
---|---|
interval | Required. The time/date interval to add. Can be one of the following values:
|
number | Required. The number of interval to add to date. Can be positive (to get dates in the future) or negative (to get dates in the past) |
date | Required. The date to which the interval should be added |
技術的な詳細
で動作します: | Access2000から |
---|
その他の例
例
現在のシステム日付に1年を追加します。
SELECT DateAdd("yyyy", 1, Date());
例
従業員の生年月日に6か月を追加します。
SELECT LastName, DateAdd("m", 6, BirthDate) FROM Employees;