If you want to difference
between two dates like as Year, Month & Days. The syntax is given below.
Datedif( start_date, end_date,
unit)
Unit
|
Explanation
|
Y
|
Gives
us number of years between two dates
|
M
|
Gives
us number of Months between two dates
|
D
|
Gives
us number of Days between two dates
|
YD
|
Gives
us difference between days (Years and dates are ignored)
|
YM
|
Gives
us difference between months (Years and days are ignored)
|
MD
|
Gives
us difference between Days (Years and Months are ignored)
|
1- When we use unit no. “Y” then results are given below…
2- When we use unit no. “M” then results are given below…
4- When we use unit no. “YD” then results are given below…
6- When we use unit no. “MD” then results are given below…