Click here to Skip to main content
15,891,316 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Dear all, please give me a solution to this error.Error message is Adding a value to a 'datetime' column caused an overflow. Below is my code.
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
End

exec buson_getEMPLOYEEIDNAME_s 2,2
Posted
Updated 5-Mar-13 21:39pm
v3
Comments
Richard C Bishop 5-Mar-13 15:40pm    
You have not provided the error message.
DhananjayanP 6-Mar-13 6:00am    
Adding a value to a 'datetime' column caused an overflow.
Maciej Los 5-Mar-13 16:59pm    
You need to check the results returnd by GetNoofDaysPerMonth(@Month, @Year) function/stored procedure.
DhananjayanP 6-Mar-13 5:55am    
result returnd by 31 days.
Maciej Los 6-Mar-13 7:15am    
What you mean? Do you want to say that above procedure/function returns the count of days in selected month?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900