While working on a scheduling application tonight, I found a neat Ruby code snippet that lets you easily convert a Ruby date range to SQL.
(6.months.ago.to_date..1.year.ago.to_date).to_s(:db) => "BETWEEN '2005-07-27' AND '2005-01-22'"