Subject Re: [firebird-support] Re: i want to this ; select avg(datefield) from ... but what?
Author Kjell Rilbe
Anderson Farias wrote:

> > But it should, don't you agree?
> IMHO, the fact that dates are internaly represented by a number does
> not make them a number. Detes are discrete (distinct) elements, I can't
> see how could one take a average from that.
> Lets say you have this set:
> [A, B, A, A, C, B] ... then, what's the avg ??
> That's the same with dates, what whould be the avg. for
> [mar-08-01, jan-08-31, may-07-29] ??

But that's not fair, because dates are just points on a continuous time
scale, whereas letters are truly discrete and not possible to plot as
points on any continuous scale at all. So, an average date would be the
date where the average point in time falls. You should probably
calculate each date as meaning "noon on that day" for such an

I agree that it's a bit muddy, but it's not unthinkable, is it?

Kjell Rilbe
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64