I have a situation here. I have a two dates, x-date and y-date. i have to do a datediff between these two dates, which is pretty much straight forward. But the problem is i have multiple x-dates for single row. I have to get average of x-date and do datediff between avg(x-date) and y-date. how to get this.
row 1 . name value .
23-4-2018 7:30 PM
23-4-2018 7:45 PM . I have to get average of
three dates and do datediff with y-date
23-4-2018 8:00 PM
30-5-2018 2:00 PM
30-5-2018 6:00 PM
31-5-2018 4:00 PM
You can actually call a date as an integer. So first cast your date to int: INT([Date]) then average the new integer. AVG(INT([Date])).
You can then take this integer and convert back to date. DATE(AVG(INT([Date])))