> Warrick Wilson wrote:
> > Jim,
> >
> > I am actually doing as you say, in terms of having a user column
> > defined as you suggest.
> >
> > However, I can't use views (the database isn't current enough, and
I
> > can't force an upgrade for this).
> >
> > I'd be happy to use a formula, but I don't know how to reference
the
> > aggregate value in a formula, nor do I know anything about Ruby to
> > actually try to create the formatting routine. Are there any
samples
> > anywhere on how to access these values (I tried {%group.sum
> > ({actualduration})} as a guess but that didn't work).
>
> There's always the bruteforce way:
>
> 1) Create a formula that initializes a sum variable
>
> sum_microsecs = 0
>
> Put it in the group header. Hide it.
>
> 2) Create a formula that adds the microsecs to the total.
>
> sum_microsecs += {table.microsecs_col}
>
> Put it in the detail row. Hide it.
>
> 3) Create a formula that returns the sum_microsecs, formatted to
your taste.
> Here's one way of doing that:
>
> MSECS_PER_SECOND = 1000
> MSECS_PER_MINUTE = MSECS_PER_SECOND * 60
> MSECS_PER_HOUR = MSECS_PER_MINUTE * 60
>
> "#{'%02d' % (sum_microsecs / MSECS_PER_HOUR)}:" +
> "#{'%02d' % ((sum_microsecs % MSECS_PER_HOUR) /
MSECS_PER_MINUTE)}:" +
> "#{'%02d' % ((sum_microsecs % MSECS_PER_MINUTE) /
MSECS_PER_SECOND)}." +
> "#{'%03d' % (sum_microsecs % MSECS_PER_SECOND)}"
>
>
> Put it in the group footer.
>
> Jim
That does the trick! Thanks.
I take it there's no way to reference the group footer intermediate
results (like my aggregate for the duration)?

Warrick Wilson
warrick@...
