ED IN AD IN OUT DIFF 12:20:00 12:10:00 12:23:00 00:00:00
when i use integer format, diff column gives exact result i.e. out-max(edin, adin); when i want them in time format it does not work; like in the example given above, diff should be 00:03:00 or even better 00:03 (omitting the second part and giving only hr; mm). below is the code i use for getting the value and put into diff column
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO chk (edin, adin, `out`, diff) VALUES (%s, %s, %s, %s)",
GetSQLValueString($_POST['edin'], "date"),
GetSQLValueString($_POST['adin'], "date"),
GetSQLValueString($_POST['out'], "date"),
GetSQLValueString($_POST['out'] - max($_POST['adin'], $_POST['edin']), "date"));