Skip to main content

Peliqan

SimplePay

Employee leave balance

SQL query for SimplePay

Calculate the remaining leave days balance for each employee.

SELECT EmployeeID, (SELECT TotalLeaveDays FROM LeaveTypes WHERE LeaveTypeID = Employees.LeaveTypeID) – SUM(LeaveDays) AS LeaveBalance FROM LeaveDays GROUP BY EmployeeID

SimplePay data model

SimplePay
Clients

SimplePay
Employees

SimplePay
Payslips

SimplePay
Leave Types

SimplePay
Leave Days

Ready to get instant access to all your company data ?​

Connect 300+ sources, serve any BI tool, and give every AI agent one governed endpoint to read, and write back where the app supports it.