SELECT `source`.`employee` AS `employee`, `source`.`employee_name` AS `employee_name`, DATE(`source`.`time`) AS `time`, TIME_FORMAT(MAX(TIME(`source`.`OUT`)), '%H:%i') AS `max`, TIME_FORMAT(MIN(TIME(`source`.`IN`)), '%H:%i') AS `min` FROM ( SELECT `tabEmployee Checkin`.`time` AS `OUT`, `tabEmployee Checkin`.`time` AS `IN`, `tabEmployee Checkin`.`employee` AS `employee`, `tabEmployee Checkin`.`employee_name` AS `employee_name`, `tabEmployee Checkin`.`time` AS `time` FROM `tabEmployee Checkin` WHERE true [[AND `tabEmployee Checkin`.`time` >= {{From_date}}]] [[AND `tabEmployee Checkin`.`time` <= DATE_ADD({{To_date}}, INTERVAL 1 DAY)]] ) `source` GROUP BY `source`.`employee`, `source`.`employee_name`, DATE(`source`.`time`) ORDER BY `source`.`employee` ASC, `source`.`employee_name` ASC, DATE(`source`.`time`) ASC;
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter