وظيفة MS Access DateDiff ()
مثال
قم بإرجاع الفرق بين تاريخين ، بالسنوات:
SELECT DateDiff("yyyy", #13/01/1998#, #09/05/2017#);
التعريف والاستخدام
ترجع الدالة DateDiff () الفرق بين تاريخين.
بناء الجملة
DateDiff(datepart, date1, date2, firstdayofweek,
firstweekofyear)
قيمه المعامل
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:
|
تفاصيل تقنية
يعمل في: | من Access 2000 |
---|
مزيد من الأمثلة
مثال
أعد الفرق بين تاريخين بالأشهر:
SELECT DateDiff("m", #13/01/1998#, #09/05/2017#);
مثال
قم بإرجاع الفرق بين تاريخ محدد وتاريخ اليوم بالأيام:
SELECT DateDiff("d", #13/01/1998#, Date());