Skip to content
Advertisement

SQL how to get the max date when already using max

I want to get the maximum f.post date, and then the maximum a.process date. When I try to use MAX(a.processdate), it won’t work because of the group by and the other MAX already used.

This is my result so far:

I want it to just return this:

Note: a.processdate is an INT (I did not create the database that way).

Advertisement

Answer

Well, you can use select top (1):

If you need to do this for multiple parent accounts, then a simple method is:

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement