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.