Sorry Planas, perhaps I have not explained clearly.

I do not want the ID column ( it had to be included to allow me to enter
data into the Rental column).

The example I gave was to show that if I did a select on the decimal field
only it displayed as a decimal
but if I preceded the decimal field in the query with another it displayed
as an integer ( no decimal places)

Hope this clears this up

regards

John

On 7 September 2011 18:00, planas <jsloz...@gmail.com> wrote:

> On Wed, 2011-09-07 at 17:34 +0100, John Mullen wrote:
>
> > 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?
> >
>
> You are selecting the value 1 and the all the values in the Rental
> column. Why it is not displaying the decimal places I do not know.
> To select the ID field you need to
>
> SELECT   "ID", "Rentals" or *
> FROM    "Contracts"
>
> > 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
> >
>
>
>
> --
> Jay Lozier
> jsloz...@gmail.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