fields calculated in sum and division of decimals

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
lramirez
Veteran Member
Posts: 46
Joined: 2019-11-01 23:23

fields calculated in sum and division of decimals

Post by lramirez » 2020-11-18 12:29

good morning
Can somebody help me...
I am adding 4 values and that total divided by 4
ex: 80.00 90.00 79.50 85.10 / 4 = 83.650000
I can't get it to just return two decimal places and make it look like this: 83.65

THANKS FOR ANY HELP

SELECT SUM(`f_academica`.`pro1`+`f_academica`.`pro2`+`f_academica`.`pro3`+`f_academica`.`pro4`) DIV(4) FROM `f_academica`
WHERE `f_academica`.`id`='%ID%'
TOTAL:83

AND

SELECT SUM(`f_academica`.`pro1`+`f_academica`.`pro2`+`f_academica`.`pro3`+`f_academica`.`pro4`) /4 FROM `f_academica`
WHERE `f_academica`.`id`='%ID%'
TOTAL:83.650000

I need 83.65 :)

THANKS FOR ANY HELP
Attachments
sql cal.png
sql cal.png (18.93 KiB) Viewed 1704 times
sql cal2.png
sql cal2.png (24.19 KiB) Viewed 1704 times
Luis Ramirez R.

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1638
Joined: 2018-04-01 10:12

Re: fields calculated in sum and division of decimals

Post by pbottcher » 2020-11-18 13:19

Hi,

use

Code: Select all

ROUND(SUM(`f_academica`.`pro1`+`f_academica`.`pro2`+`f_academica`.`pro3`+`f_academica`.`pro4`) /4,2)
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

lramirez
Veteran Member
Posts: 46
Joined: 2019-11-01 23:23

Re: fields calculated in sum and division of decimals

Post by lramirez » 2020-11-18 13:25

yeah
Thank you very much for the help
... today I learned more ...
Luis Ramirez R.

Post Reply