Date Range SQL clause in ruby
Here is how to do it:
Date range to SQL clause
(6.months.ago.to_date..1.year.ago.to_date).to_s(:db) => ?BETWEEN ?2005-07-27? AND ?2005-01-22??
codes a lot
If the code is inexplicably missing from some of my posts it is because gist.github.com is down at the moment. Check back a little later.
Here is how to do it:
Date range to SQL clause
(6.months.ago.to_date..1.year.ago.to_date).to_s(:db) => ?BETWEEN ?2005-07-27? AND ?2005-01-22??