Date Difference Using Sql Aggregate Query