Perhaps you want the decimal years representing the fractional time between two dates. You might be inclined to use datediff in months and to divide by 12, but dividing by an int returns an int. The fix is simple, divide by a decimal:datediff(months,begin_date,end_date)/12 .0
↧