Diff Date Sql. The following illustrates the syntax of the datediff function in sql server. Datediff datepart startdate enddate.
You can use different date format to calculate difference of dates. The two dates to calculate the difference between. Datediff datepart startdate enddate.
You can use only two digits as years as well query.
Select datediff day 200604 200805 as date difference from dual. You can use only two digits as years as well query. To calculate the difference between two dates you use the datediff function. Each statement returns 1.
