Skip to content

Tag: sql-server

Datediff on 2 rows of a table with a condition

My data looks like the following Now, I want to calculate the datediff between the closeddates for teams A, and B, if the max closeddate for team A is greater than max closeddate team B. If it is smaller or null I don’t want to see them. So, for example,I want to see only one record like this : and