Tutorial SQL

SQL RUMAH Pengenalan SQL Sintaks SQL Pilih SQL SQL Pilih Berbeda SQL Dimana SQL Dan, Atau, Tidak Perintah SQL Oleh SQL Sisipkan Ke Nilai Null SQL Pembaruan SQL Hapus SQL SQL Pilih Atas SQL Min dan Maks Hitung SQL, Rata-Rata, Jumlah SQL Suka SQL Wildcard SQL In SQL Antara SQL Alias SQL Bergabung Gabung Dalam SQL SQL Kiri Gabung SQL Benar Bergabung Gabung Penuh SQL SQL Self Gabung SQL Union Grup SQL Oleh SQL Memiliki SQL Ada SQL Apa saja, Semua SQL Pilih Ke Sisipkan SQL Ke Pilih Kasus SQL Fungsi SQL Null Prosedur Tersimpan SQL Komentar SQL Operator SQL

Basis Data SQL

SQL Buat DB SQL Drop DB SQL Cadangan DB SQL Buat Tabel Tabel Jatuhkan SQL Tabel Ubah SQL Batasan SQL SQL Bukan Null SQL Unik Kunci Utama SQL Kunci Asing SQL Pemeriksaan SQL SQL Default Indeks SQL Peningkatan Otomatis SQL Tanggal SQL Tampilan SQL Injeksi SQL SQL Hosting Tipe Data SQL

Referensi SQL

Kata Kunci SQL Fungsi MySQL Fungsi SQL Server Fungsi Akses MS Referensi Cepat SQL

Contoh SQL

Contoh SQL Kuis SQL Latihan SQL Sertifikat SQL

Fungsi MS Access DatePart()

Fungsi Akses MS

Contoh

Kembalikan bagian tahun dari tanggal yang ditentukan:

SELECT DatePart("yyyy", #09/05/2017#);

Definisi dan Penggunaan

Fungsi DatePart() mengembalikan bagian tertentu dari tanggal, sebagai bilangan bulat.

Sintaksis

DatePart(datepart, date, firstdayofweek, firstweekofyear)

Nilai Parameter

Parameter Description
datepart Required. The date part to return. Can be one of the following values:
  • yyyy = Year
  • q = Quarter
  • m = month
  • y = Day of the year
  • d = Day
  • w = Weekday
  • ww = Week
  • h = hour
  • n = Minute
  • s = Second
date Required. The date value to be evaluated
firstdayofweek Optional. Specifies the first day of the week. Can be one of the following values:
  • 0 = Use the NLS API setting
  • 1 = Sunday (default)
  • 2 = Monday
  • 3 = Tuesday
  • 4 = Wednesday
  • 5 = Thursday
  • 6 = Friday
  • 7 = Saturday
firstdayofyear Optional. Specifies the first week of the year. Can be one of the following values:
  • 0 = Use the NLS API setting
  • 1 = Use the first week that includes Jan 1st (default)
  • 2 = Use the first week in the year that has at least 4 days
  • 3 = Use the first full week of the year

Detail Teknis

Bekerja di: Dari Akses 2000

Lebih Banyak Contoh

Contoh

Kembalikan bagian bulan dari tanggal yang ditentukan:

SELECT DatePart("m", #09/05/2017#);

Contoh

Kembalikan hari kerja dari tanggal hari ini:

SELECT DatePart("w", Date());

Fungsi Akses MS