This gets weirder.

Try this:    Create a table CONTRACTS with an INTEGER field (ID)  as a
Primary key, set to auto fill
 and a decimal field  (Rental) set to 2 decimal places.

Add the value 150.00 to the first row.

Run the query

SELECT "CONTRACTS"."Rental" FROM "CONTRACTS"

this returns 150.00

Good so far.

Now run the query


SELECT  1.00, "CONTRACTS.Rental" FROM "CONTRACTS"

this returns  1.00    150

Any idea why?

regards

John

On 6 September 2011 20:48, Andreas Säger <ville...@t-online.de> wrote:

>
> Steve Edmonds wrote:
> >
> > Hi.
> >>From the original posters example, he has decimal places, just not
> > trailing zeros. I think the calculation is correct just the display of
> > the result needs formatting. I don't use Base (yet) but is the correct
> > data type for currency DECIMAL. Can the field display format be set by
> > right clicking the field in the form as in a form letter.
> > steve
> >
> >
> The DATEDIF function returns an integer, 7 is an integer. So there is no
> decimal involved in the calculation and the result is an integer despite
> the
> division. No formatting attribute will change an iteger number. Any
> currency
> format will end with .00 if the formatted value is an integer one.
>
> How about this one with the last brace shifted:
> ABS( DATEDIFF( 'dd', "RENT_PAYMENTS"."Date_Paid", CURDATE( ) ) )  /  7.00
> (first get the absolute day difference, then divide by decimal 7.00)
>
> --
> View this message in context:
> http://nabble.documentfoundation.org/Calculated-fields-not-showing-decimal-places-in-BASE-query-tp3313752p3314620.html
> Sent from the Users mailing list archive at Nabble.com.
>
> --
> For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
> Problems?
> http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
> List archive: http://listarchives.libreoffice.org/global/users/
> All messages sent to this list will be publicly archived and cannot be
> deleted
>
>


-- 
Cheapest mobile tariffs - GUARANTEED <http://www.discoverhow.co.uk/>

"I train people to make money" <http://www.makemoney.discoverhow.co.uk/>

"Action always beats inaction" - Robert T. Kiyosaki

-- 
For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Reply via email to