0

我需要将 Bacice Salary 转换为十进制值,我想在其中给出

SELECT CONVERT(DECIMAL(10,2)

这是我的程序:

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
4

1 回答 1

4

只需convert在您的选择查询中使用

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 
于 2013-03-15T08:25:56.860 回答