Reputation: 13
I need to convert the Bacice Salary to decimal values, where I want to give the
SELECT CONVERT(DECIMAL(10,2)
This is my procedure:
ALTER Procedure [dbo].[buson_getEMPLOYEEIDNAME_s]
(
@Month INT,
@Year INT
)
As
Begin
SELECT
EmpId, Name,
(BUSON_SALARYSTR.BASICSALARY / dbo.GetNoofDaysPerMonth(@Month, @Year)) *
(dbo.GetNoofDaysPerMonth(@Month, @Year) - dbo.NoofdaysAbsent(EmpId,@Month,@Year)) as Basicsalary ,BUSON_SALARYSTR.CODE
FROM
BUSON_EMP
INNER JOIN
BUSON_SALARYSTR ON BUSON_SALARYSTR.CODE = BUSON_EMP.SalaryStructure
AND BUSON_EMP.EmpId IN (SELECT DISTINCT T1.EmpId
FROM BUSON_ATTENDANCE T0
JOIN BUSON_ATTENCHILD T1 ON T0.DocEntry = T1.DocEntry AND Year(T0.DateofAttendance) = @Year AND MONTH(T0.DateofAttendance) = @Month)
End
Upvotes: 0
Views: 8998
Reputation: 12271
Just use convert
in your select query
Select EmpId,Name,
convert(decimal(10,2),(BUSON_SALARYSTR.BASICSALARY / dbo.GetNoofDaysPerMonth(@Month, @Year)) *
(dbo.GetNoofDaysPerMonth(@Month, @Year) - dbo.NoofdaysAbsent(EmpId,@Month,@Year)))
as Basicsalary ,... rest of your code
Upvotes: 4