How to get Avg Date in SQL Qry

后端 未结 2 1156
说谎
说谎 2021-01-15 14:45

I am trying to get the Average Date in sql and am not sure how to do this. I have the following fields:

ID   Date1             Date2                   Date3         


        
2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-15 15:11

    select id, date1, date2, date3
    ,Cast(
    (cast(date1 as Float) + cast(date2 as Float) + cast(date3 as Float))/3
    as Datetime) as AvgDate
    from yourtable
    

提交回复
热议问题