Is it possible to create a query with comparison between fields?
Accepted answer
I don't think it's possible with RTC queries. You have to create custom reports or add third attribute and use script to store difference between dates like here:
https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Script_based_calculated_values
Another way is to export pre-filtered work items to csv and compare dates in spreadsheet application.