Base Query Functions with Decimals/Dollar figures

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?

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.

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.

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.

Good to hear.