select date_format(`orangehrms_new`.`hs_hr_attendance`.`punchin_time`,'%H:%i:%s') AS `punchin_time`,date_format(`orangehrms_new`.`hs_hr_attendance`.`punchout_time`,'%H:%i:%s') AS `punchout_time`,`orangehrms_new`.`biometricemail_all`.`Department` AS `Department`,`orangehrms_new`.`biometricemail_all`.`mailTo` AS `mailTo`,`orangehrms_new`.`biometricemail_all`.`EmpStatus` AS `EmpStatus`,`orangehrms_new`.`biometricemail_all`.`EmailID` AS `EmailID`,`orangehrms_new`.`hs_hr_attendance`.`in_note` AS `in_note`,`orangehrms_new`.`hs_hr_attendance`.`out_note` AS `out_note`,`orangehrms_new`.`hs_hr_attendance`.`punchin_time` AS `ptime` from (`orangehrms_new`.`hs_hr_attendance` join `orangehrms_new`.`biometricemail_all` on((`orangehrms_new`.`biometricemail_all`.`EmpID` = `orangehrms_new`.`hs_hr_attendance`.`employee_id`))) order by date_format(`orangehrms_new`.`hs_hr_attendance`.`punchin_time`,'%H:%i:%s')