Please help me on sql queries for round up the value after fetching from Access database. I'm working on generating mark-sheet using php and access. But can't round up the values on a single query. I'm trying to add values but this supposed to be round up first before the addition. I mean if marks field contain 14.5 then should be 15 before adding but not converting the actual database value. Here is my code...
if(isset($_GET['action']) && $_GET['action']=='rlist'){
if($_GET['element_1']=="IX"){
if( $_GET['element_2']!=1){
$sql="select m.StudentId,StudentName, m.Roll,m.Sec,m.P1,m.P2,m.P3,m.S1,m.S2,m.S3,m.Total from StudentMain right join(select StudentId, Roll, Sec,Sum(iif(ExamType=4,Marks,0)) as P1,Sum(iif(ExamType=5,Marks,0)) as P2,Sum(iif(ExamType=6,Marks,0)) as P3, Sum(iif(ExamType=1,Marks,0)) as S1,Sum(iif(ExamType=2,Marks,0)) as S2,Sum(iif(ExamType=3,Marks,0)) as S3, (S1+S2+S3+P1+P2+P3) as Total from Marks where Class='".$_GET['element_1']."' and Sec='".$_GET['element_2']."'group by StudentId,Roll,Sec) as m on StudentMain.StudentId=m.StudentId order by m.Roll";}}}
$rs = odbc_exec($conn,$sql)or die (print odbc_errormsg());'