计算不同日期时间值的SUM

时间:2017-03-26 02:51:13

标签: php datetime sum

我有几个日期时间查询。我需要获得SUM并显示用户端。我怎样才能做到这一点?

查询

-v

我尝试了这个,但它不起作用......

    $sqlmon="SELECT * , TIMEDIFF(t.timeouthour, t.timeinhour) AS Duration 
    FROM timesheets t 
    WHERE employee_id='$session_myemployeeid' 
    AND timeinyear='$currentyear' 
    AND timeinmonth='$currentmonth' 
    AND timeinday='Monday' ";
    $resultmon=mysqli_query($db,$sqlmon);

    $sqltues="SELECT * , TIMEDIFF(t.timeouthour, t.timeinhour) AS Duration 
    FROM timesheets t WHERE employee_id='$session_myemployeeid' 
    AND timeinyear='$currentyear' 
    AND timeinmonth='$currentmonth' 
    AND timeinday='Tuesday' ";
    $resulttuesday=mysqli_query($db,$sqltues);
    [5 more...]

1 个答案:

答案 0 :(得分:0)

我找到了答案here

 session.finishTasksAndInvalidate()