Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- dayofmonth(
- TIMESTAMPADD(
- SECOND,
- timestamp_diff,
- hha.punchin_time
- )
- )AS day_of_month,
- TIMESTAMPADD(
- SECOND,
- timestamp_diff,
- hha.punchin_time
- )AS PUNCH_IN,
- TIMESTAMPADD(
- SECOND,
- timestamp_diff,
- hha.punchout_time
- )AS PUNCH_OUT,
- TIMEDIFF(
- (hha.punchout_time),
- (hha.punchin_time)
- )AS shift_time,
- in_note,
- out_note,
- hhe.emp_firstname AS First_Name,
- hhe.emp_lastname AS Last_Name
- FROM
- `hs_hr_attendance` hha
- LEFT JOIN hs_hr_employee hhe ON hhe.employee_id = hha.employee_id
- AND hha.employee_id = 2
- *******************************************************************
- SELECT
- dayofmonth(
- TIMESTAMPADD(
- SECOND,
- timestamp_diff,
- hha.punchin_time
- )
- )AS day_of_month,
- SEC_TO_TIME(
- SUM(
- TIME_TO_SEC(TIMEDIFF(
- ((hha.punchout_time)),
- ((hha.punchin_time))
- ))
- )
- )
- AS shift_time,
- out_note,
- hhe.emp_firstname AS First_Name,
- hhe.emp_lastname AS Last_Name
- FROM
- `hs_hr_attendance` hha
- LEFT JOIN hs_hr_employee hhe ON hhe.employee_id = hha.employee_id
- AND hha.employee_id = 2 AND hha.employee_id = NULL
- GROUP BY day_of_month
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement