如何计算两个表之间的平均日期?

时间:2017-03-13 12:30:38

标签: sql

select t.TransCode, avg(d.SetupDate - t.MonthPosted) as avgdate
from Debtor as D
join Trans as T
    on T.DebtorNo = D.LogonID
where t.TransCode in ('411', '412', '413', '416') 
group by t.TransCode 

我正在

  

操作数数据类型日期对于减法运算符无效。

0 个答案:

没有答案