SQL9x defines intervals for date calculations. Relevant part of the
SQL spec:
> 4.7.2 Intervals
> There are two classes of intervals. One class, called year-month
> intervals, has an express or implied
> datetime precision that includes no fields other than YEAR and
> MONTH, though not both are
> required. The other class, called day-time intervals, has an
> express or implied interval precision
> that can include any fields other than YEAR or MONTH.
These are what you''re after.
Sadly, database support for them is liable to be patchy (DB2 and
oracle implement as per the spec I think, postgres implements in a
sort of funky way, I don''t think mysql suports them in any way,
although I may be wrong on this)
On top of that, ActiveRecord doesn''t support them as far as I can
tell, so you''re going to have to use some funky sql to make your
updates.
Simon