Funzione di MS Access DateDiff()
Esempio
Restituisce la differenza tra due date, in anni:
SELECT DateDiff("yyyy", #13/01/1998#, #09/05/2017#);
Definizione e utilizzo
La funzione DateDiff() restituisce la differenza tra due date.
Sintassi
DateDiff(datepart, date1, date2, firstdayofweek,
firstweekofyear)
Valori dei parametri
Parameter | Description |
---|---|
datepart | Required. The part to return. Can be one of the following values:
|
date1 and date2 | Required. The two dates to calculate the difference between |
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
Restituisce la differenza tra due date, in mesi:
SELECT DateDiff("m", #13/01/1998#, #09/05/2017#);
Esempio
Restituisce la differenza tra una data specificata e la data odierna, in giorni:
SELECT DateDiff("d", #13/01/1998#, Date());