How can I show all deductions for a single employee?

0

This is my current view that shows me the deductions of the employees what I need is to show all the deductions of an employee

If you can see here, it shows all of them, what I want is for you to show me all of the 2390 employee, for example, who is the one who has the most

SELECT dbo.Tbl_DetalleDeduccionesEmpleado.DetDedEmpFecha, dbo.Tbl_DetalleDeduccionesEmpleado.DetDedEmpValor, dbo.Tbl_Empleado.EmpNombre, dbo.Tbl_Empleado.EmpApellido, dbo.Tbl_HistorialLaboral.AgeId, 
dbo.Tbl_HistorialLaboral.AreId, dbo.Tbl_HistorialLaboral.HisLabEstadoEmpleado, dbo.Tbl_Deducciones.DedDescripcion, dbo.Tbl_DetalleDeduccionesEmpleado.DedId, dbo.Tbl_DetalleDeduccionesEmpleado.EmpId, 
dbo.Tbl_Deducciones.DedTipo FROM dbo.Tbl_DetalleDeduccionesEmpleado INNER JOIN
dbo.Tbl_Empleado ON dbo.Tbl_DetalleDeduccionesEmpleado.EmpId = dbo.Tbl_Empleado.EmpId INNER JOIN
dbo.Tbl_HistorialLaboral ON dbo.Tbl_Empleado.EmpId = dbo.Tbl_HistorialLaboral.EmpId INNER JOIN
dbo.Tbl_Deducciones ON dbo.Tbl_DetalleDeduccionesEmpleado.DedId = dbo.Tbl_Deducciones.DedId

perfect Ricardo thank you very much ..

    
asked by Marco Eufragio 16.10.2018 в 18:27
source

1 answer

2

What you need to do is add Where to say that you need only that employee's data:

SELECT dbo.Tbl_DetalleDeduccionesEmpleado.DetDedEmpFecha, dbo.Tbl_DetalleDeduccionesEmpleado.DetDedEmpValor, dbo.Tbl_Empleado.EmpNombre, dbo.Tbl_Empleado.EmpApellido, dbo.Tbl_HistorialLaboral.AgeId, 
dbo.Tbl_HistorialLaboral.AreId, dbo.Tbl_HistorialLaboral.HisLabEstadoEmpleado, dbo.Tbl_Deducciones.DedDescripcion, dbo.Tbl_DetalleDeduccionesEmpleado.DedId, dbo.Tbl_DetalleDeduccionesEmpleado.EmpId, 
dbo.Tbl_Deducciones.DedTipo FROM dbo.Tbl_DetalleDeduccionesEmpleado INNER JOIN
dbo.Tbl_Empleado ON dbo.Tbl_DetalleDeduccionesEmpleado.EmpId = dbo.Tbl_Empleado.EmpId INNER JOIN
dbo.Tbl_HistorialLaboral ON dbo.Tbl_Empleado.EmpId = dbo.Tbl_HistorialLaboral.EmpId INNER JOIN
dbo.Tbl_Deducciones ON dbo.Tbl_DetalleDeduccionesEmpleado.DedId = dbo.Tbl_Deducciones.DedId Where dbo.Tbl_Empleado.EmpId = 2390
    
answered by 16.10.2018 / 18:37
source