Hi Franco
> Yes. Let's imagine a very common situation: we need to calculate a
> markup based on some percentage. At the beginning, we have two fields:
> the net price and the percentage rate. With them we can create a first
> calculated field inserting this simple formula:
>
> "net price" * "rate" / 100 AS "markup"
>
> Now, if we need also the SUM of "net price" and "markup" (very common in
> real life), we'll create a second calculated field, where we must
> "repeat" the formula above and sum it to the net price, as follows:
>
> "net price" + ("net price" * "rate" /100) AS "total"
>
> Right? Well, in case of very simple calculated fields this couldn't be a
> big problem, but when the formula is more complicated, isn't a safe
> solution to repeat it in different places inside the same application.
> Do you agree? It would be safer if we could use, for the second
> calculated filed, this formula:
>
> "net price" + "markup" AS "total"
>
> This way, we'd have only one instance for each formula in our whole
> application.
Okay, this was what I understood, but I wanted to be sure we're on the
same track :)
No, in fact this is not possible with HSQL, though other engines (MSA:
yes, MySQL: no) support this. I agree that this is useful sometimes -
you might want to submit an RFE requesting this ....
Ciao
Frank
--
- Frank Schönheit, Software Engineer [EMAIL PROTECTED] -
- Sun Microsystems http://www.sun.com/staroffice -
- OpenOffice.org Database http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]