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
fields calculated in sum and division of decimals
fields calculated in sum and division of decimals
- Attachments
-
- sql cal.png (18.93 KiB) Viewed 1707 times
-
- sql cal2.png (24.19 KiB) Viewed 1707 times
Luis Ramirez R.
Re: fields calculated in sum and division of decimals
Hi,
use
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.
Re: fields calculated in sum and division of decimals
yeah
Thank you very much for the help
... today I learned more ...
Thank you very much for the help
... today I learned more ...
Luis Ramirez R.