Currently no, you have to issue two queries for each of your date
ranges, then do the comparison.
Supporting 2 date ranges like in the UI is probably a good feature
request.
I'd be interested to see how many other developers would find this
useful.
-Nick