Multiply and divide dates I had a recent DBA.SE question that involved dates that were used as the x-axis in a graph: Interpolate dates along a line.

It was centred around a road_condition table:

COND_ID ROAD_ID   COND_DATE  CONDITION
------- -------   --------   ---------
      1     100   84-11-01          18
      2     100   09-01-01           6
      3     100   12-06-19           4
      4     100   15-04-29           4

      5     200   92-04-29          20
      6     200   17-04-05           3


Note: I consider cond_date to be the X-axis, and condition to be the Y-axis.

In my an attempt to answer my own question, I tried to do things like use cond_date as X1 in a calculation:

y1 - ((y2-y1)/(x2-x1)) * x1 as y_intercept

However, obviously I can't just use a date in a calculation that involves multiplication or division; dates are not traditional numbers. 

As a work around, I stripped the date of its month and day: extract(year from cond_date) and performed the calculations from there on the resulting integer (the year). However, by doing this, I of course lose valuable precision in the number. This compromises the output of the calculation.

How can I multiply and divide dates, without losing precision?
Slope is a numeric concept.  It does not make sense to have a slope with time unless you already have a unit for it.  Fortunately we have date arithmetic in Oracle that can help you out.  To do this you need to convert to a numeric quantity as you have noted.

Date arithmetic works with addition and subtraction and this can create scoped numeric representations of this for your purposes.  Slope is easy enough (no modifications there since you are subtracting dates first).  The intercept is more interesting.  The question is at what date x = 0 is at.  If you subtract that date from x1, then you will get a numeric result that you can use for your multiplication factor.