Fungsi MS Access DateAdd()
Contoh
Tambahkan dua tahun ke tanggal yang ditentukan:
SELECT DateAdd("yyyy", 2, #22/11/2017#);
Definisi dan Penggunaan
Fungsi DateAdd() menambahkan interval waktu/tanggal ke tanggal dan kemudian mengembalikan tanggal.
Sintaksis
DateAdd(interval, number, date)
Nilai Parameter
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 |
Detail Teknis
Bekerja di: | Dari Akses 2000 |
---|
Lebih Banyak Contoh
Contoh
Tambahkan satu tahun ke tanggal sistem saat ini:
SELECT DateAdd("yyyy", 1, Date());
Contoh
Tambahkan 6 bulan ke tanggal lahir karyawan:
SELECT LastName, DateAdd("m", 6, BirthDate) FROM Employees;