garyz31
asked on
Aggregate function for DateTime variables??
I have a table that contains a DateTime column, and another column that I want to use as the group indicator. I haven't found a function that will select the latest or earliest of the DateTime values for each group. Does one exist?
Thanks
Thanks
you can also combine the two above...
select Group, max(date), min(date)
from Table
group by group
select Group, max(date), min(date)
from Table
group by group
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks: I got distracted from this project for quite a while.
Latest Date for each group:
Select Group, Max(Date)
From Table
Group By Group
Earliest Date for each group:
Select Group, Min(Date)
From Table
Group By Group