SELECT
att.employee AS “Employee”,
att.employee_name AS “Employee Name”,
DATE(att.time) AS “Date”,
TIMEDIFF(MAX(att.time), MIN(att.time)) AS “Total Time”
FROM
`tabEmployee Checkin` AS att
WHERE
att.employee = ‘${frm.doc.employee}’
GROUP BY
att.employee, DATE(att.time)
how to give another doctype field value for where cluse?
Just consider the scenario Employee doctype and child doctype Phone. i want to display phone numbers of each employee
SELECT
e.name,
e.first_name,
COALESCE(GROUP_CONCAT(e.mobile_no SEPARATOR ', '), '') AS PhoneNumber
FROM
tabEmployee e
LEFT JOIN
tabPhone p ON e.name = p.parent
WHERE
e.status = 'Yes'
GROUP BY
e.name, e.first_name
SELECT
att.employee AS "Employee",
att.employee_name AS "Employee Name",
DATE(att.time) AS "Date",
TIMEDIFF(MAX(att.time), MIN(att.time)) AS "Total Time",
emp.department AS "Department"
FROM
`tabEmployee Checkin` AS att
JOIN
`tabEmployee` AS emp ON att.employee = emp.name
WHERE
emp.department = 'Sales' -- Example: filter where employee's department is 'Sales'
GROUP BY
att.employee, DATE(att.time)
I checked those videos but there is filter we want to select one field based on that the query will executing,
But I want without the filter fields, based on Employee doctype employee field the filter is automatically append based on the employee login the portal
SELECT
att.employee AS “Employee”,
att.employee_name AS “Employee Name”,
DATE(att.time) AS “Date”,
TIMEDIFF(MAX(att.time), MIN(att.time)) AS “Total Time”
FROM tabEmployee Checkin AS att
WHERE
att.employee = %(employee)s
GROUP BY
att.employee, DATE(att.time)
This logic does not work in a query report. And read the reference post which I have given you carefully because query report side has some limitations, not everything is possible.