You can't do this in JQL. A solution might be to create a calculated field which stores the difference between the two dates and use JQL to search based on the calculated field.
You can either create the calculate field using a plugin or use some scripted fields like the one from Scriptrunner plugin: https://studio.plugins.atlassian.com/wiki/display/GRV/Scripted+Fields.
If you are just looking for information about the time in each status for issues, JIRA Suite Utilities will give you a new Transition tab in JIRA.
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG