Date Difference Using Sql Aggregate Operations