Ask Your Question

Base Query Functions with Decimals/Dollar figures

asked 2017-03-23 17:48:12 +0100

bdragon254 gravatar image

For some reason when I use Functions to calculate figures it automatically removes decimal places. I cannot use it for dollar figures!

Each field which contains a dollar figure is set to DECIMAL in the TABLE. Specifies 2 decimal places and in format example, it shows the format properly.

It works fine until I use Functions like SUM, GROUP and COUNT. Instead of showing the entire dollar amount it just shows a whole number. Any ideas?

edit retag flag offensive close merge delete



Can't see where you are having a problem based on the info provided. COUNT is confusing as to what is meant. SUM should provide no problem. Please provide a sample SQL statement where you say it isn't working. Also what DB are you using - embedded, split, external (MySQL, PostgreSQL etc)? LO version & OS might help.

Ratslinger gravatar imageRatslinger ( 2017-03-23 19:51:45 +0100 )edit

2 Answers

Sort by » oldest newest most voted

answered 2017-03-23 20:34:55 +0100

bdragon254 gravatar image

I fixed it, however, I do not know what the exact problem was. My theory is maybe the field was originally set to something non-numerical (like VARCHAR) and then changed to DECIMAL after there was data entered. I think this confused LibreOffice Base and the Query was unable to change it EVEN THOUGH the TABLE reflects the correct format. My only resolution was to delete the field and recreate it as a DECIMAL field, while making sure it had the appropriate decimal places.

edit flag offensive delete link more


Good to hear.

EasyTrieve gravatar imageEasyTrieve ( 2017-03-25 00:10:04 +0100 )edit

answered 2017-03-23 20:34:13 +0100

EasyTrieve gravatar image

Perhaps you are mixing integers with decimals like by multiplying a count times an amount in such a way as to produce an integer result. Once we know which database you are using I can give more specifics.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-03-23 17:48:12 +0100

Seen: 180 times

Last updated: Mar 23 '17