Funzione DatePart() di MS Access
Esempio
Restituire la parte dell'anno della data specificata:
SELECT DatePart("yyyy", #09/05/2017#);
Definizione e utilizzo
La funzione DatePart() restituisce una parte specificata di una data, come numero intero.
Sintassi
DatePart(datepart, date, firstdayofweek,
firstweekofyear)
Valori dei parametri
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:
|
Dettagli tecnici
Funziona in: | Da Access 2000 |
---|
Altri esempi
Esempio
Restituire la parte del mese della data specificata:
SELECT DatePart("m", #09/05/2017#);
Esempio
Restituisci il giorno della settimana della data odierna:
SELECT DatePart("w", Date());