chrisdoesstuff
Technical User
SQL server 2008 Maybe I'm missing something easy, at least it seems so but I have a datetime field that I need to select the max of. I was hoping I could do this as part of my join but it might be more work than that.
The data is as follows
Table: TeamTable
Columns: Team_Name, Last_Changed_Time
The query is
LEFT OUTER JOIN Teamtable T
ON O.ObjectID = t.ObjectID
AND t.team_name = 'blue'
What I want is
AND Last_Changed_Time = MAX(Last_Changed_time)
I know that I can't do that since it didn't work but what might be the best way to accomplish this. It seems like it should be quick but I'm not coming up with it. Any help is appreciated. Thanks
The data is as follows
Table: TeamTable
Columns: Team_Name, Last_Changed_Time
The query is
LEFT OUTER JOIN Teamtable T
ON O.ObjectID = t.ObjectID
AND t.team_name = 'blue'
What I want is
AND Last_Changed_Time = MAX(Last_Changed_time)
I know that I can't do that since it didn't work but what might be the best way to accomplish this. It seems like it should be quick but I'm not coming up with it. Any help is appreciated. Thanks