Shredding Query Plan XML For Potential Skewed Estimates - Data Type Conversions
If you can't do it in one query, then put the results from the first query into a #temporary table.  Now do a second query to do the math.