RE: [users] Multiply 2 fields in Base Query

"G. Roderick Singleton" <[email protected]>
Newsgroups gmane.comp.openoffice.dba.user
Organization OpenOffice.org
Message-ID <[email protected]>
Sorry. I have packed my refernces for SQL. (moving day is tomorrow)
You know it might be worthwhile asking on the user@dba list. I have cc'd
that list and so encourage you to look there for answers too.


On Thu, 2005-07-28 at 16:10 +0200, Gert Blij wrote:
> Thanks again Roderick,
> 
> I found that it is possible, see quotes below. What I can't find (and I
> promise I have googled, KBed and Manualed it to death), is what the correct
> syntax is, either in SQL View or Design View, i.e. how do I present the
> FIELD1 * FIELD2 (like in Access it was [FIELD1] * [FIELD2]). Any suggestions
> where to start looking? (Of course I don't know the version numbers, but
> they mention that in the latest version the "have improved it", so in some
> form it must have been there for a while.
> 
> TIA
> Gert
> 
> "
> Expressions
> 
> Arithmetic expressions in SQL statements are now fully supported.
> Previously, when an arithmetic expression was used to INSERT or UPDATE a
> value, the first term had to be of the same type as the columns. For example
> 2*1.2 could not be inserted into a DECIMAL or DOUBLE column. Now all
> expressions are evaluated and the resulting value can be inserted into a
> column so long as it can be converted without narrowing.
> 
> More lenient treatment of values for TIMESTAMP columns in INSERT and UPDATE
> now allows a DATE or part TIMESTAMP string to be used instead of the full
> pattern.
> 
> BIT columns can be initialised with numeric values in addition to true and
> false. Numeric value 0 represents false; all other values represent true.
> 
> 
> 
> 
> Components of SQL Expressions
> 
> value
> 
>    [+ | -] { term [{ + | - | * | / | || } term]
> " 
> 
> > -----Original Message-----
> > From: G. Roderick Singleton [mailto:[email protected]] 
> > Sent: Thu 28 July 2005 01:23
> > To: [email protected]
> > Cc: OpenOffice
> > Subject: Re: [users] Multiply 2 fields in Base Query
> > 
> > On Thu, 2005-07-28 at 12:50 +0200, Gert Blij wrote:
> > > Is it possible to multiply 2 fields in a query?
> > > 
> > > FE, I have three fields, ItemNo, Qty and Price which I query, but I 
> > > want to display the extended price as well. In Access the syntax is 
> > > [Qty]*[Price]
> > > 
> > 
> > It depends on the version of HSQLDB integrated in OOo. To 
> > quote from the latest HSQLDB docs:
> > "Previous versions of HSQLDB featured poor handling of 
> > arithmetic operations. For example, it was not possible to 
> > insert 10/2.5 into any DOUBLE or DECIMAL column. Since 1.7.0, 
> > full operations are possible with the following rules: ... "
> > 
> > Since OOo integration often lags the current release of 
> > HSQLDB, this may be the problem. For help with HSQLDB, goto 
> > http://hsqldb.sourceforge.net/web/hsqlDocsFrame.html 
> > 
> > --
> > PLEASE KEEP MESSAGES ON THE LIST.
> > OpenOffice.org Documentation Co-Lead
> > http://documentation.openoffice.org/ 
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
-- 
PLEASE KEEP MESSAGES ON THE LIST.
OpenOffice.org Documentation Co-Lead
http://documentation.openoffice.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.