Click here to Skip to main content
16,009,112 members
Home / Discussions / Database
   

Database

 
GeneralRe: problem gettin specific record.. Pin
Colin Angus Mackay28-May-07 1:48
Colin Angus Mackay28-May-07 1:48 
GeneralRe: problem gettin specific record.. Pin
rcwoods28-May-07 2:04
rcwoods28-May-07 2:04 
GeneralRe: problem gettin specific record.. Pin
Colin Angus Mackay28-May-07 2:17
Colin Angus Mackay28-May-07 2:17 
GeneralRe: problem gettin specific record.. Pin
rcwoods28-May-07 3:55
rcwoods28-May-07 3:55 
GeneralRe: problem gettin specific record.. Pin
sam#28-May-07 2:03
sam#28-May-07 2:03 
GeneralRe: problem gettin specific record.. Pin
rcwoods28-May-07 3:48
rcwoods28-May-07 3:48 
GeneralRe: problem gettin specific record.. Pin
rcwoods28-May-07 3:52
rcwoods28-May-07 3:52 
QuestionStored procedure probs..., [modified] Pin
Member 387988127-May-07 19:11
Member 387988127-May-07 19:11 
Hi in this procedure whats the problem in that "bonus" field...,
See i want to check my Bonus in "check" condition...,
But i am getting error statement...,
so plz any one help me...,

CREATE PROCEDURE Bonus
(
@projectid as int,
@BDate as smalldatetime,
@BMonths as tinyint
)
As
declare
@days1 as tinyint
begin


SELECT dbo.tblEmployeeMaster.empId, dbo.tblEmployeeMaster.empName, dbo.tblEmployeeMaster.joinDate,
(dbo.tblsalarydetails.BasSalary)+(dbo.tblsalarydetails.Hra)+(dbo.tblsalarydetails.Ca)+(dbo.tblsalarydetails.Ota)+
(dbo.tblsalarydetails.Sha)+(dbo.tblsalarydetails.Allow1)+(dbo.tblsalarydetails.Allow2)+(dbo.tblsalarydetails.Allow3)+
(dbo.tblsalarydetails.Allow4)+(dbo.tblsalarydetails.Allow5) as GTotal,
datediff(Month,dbo.tblEmployeeMaster.joinDate,@BDate) as WMonths,
(
case when ( ((datediff(Month,dbo.tblEmployeeMaster.joinDate,@BDate))>=@BMonths) and
((datediff(Month,dbo.tblEmployeeMaster.joinDate,@BDate))<12 )
)then
(
(
(dbo.tblsalarydetails.BasSalary)+(dbo.tblsalarydetails.Hra)+(dbo.tblsalarydetails.Ca)+
(dbo.tblsalarydetails.Ota)+(dbo.tblsalarydetails.Sha)+(dbo.tblsalarydetails.Allow1)+
(dbo.tblsalarydetails.Allow2)+(dbo.tblsalarydetails.Allow3)+(dbo.tblsalarydetails.Allow4)+
(dbo.tblsalarydetails.Allow5)
)*datediff(Month,dbo.tblEmployeeMaster.joinDate,@BDate)
)/12
else
((datediff(Month,dbo.tblEmployeeMaster.joinDate,@BDate))>=12 )
(dbo.tblsalarydetails.BasSalary)+(dbo.tblsalarydetails.Hra)+(dbo.tblsalarydetails.Ca)+
(dbo.tblsalarydetails.Ota)+(dbo.tblsalarydetails.Sha)+(dbo.tblsalarydetails.Allow1)+
(dbo.tblsalarydetails.Allow2)+(dbo.tblsalarydetails.Allow3)+(dbo.tblsalarydetails.Allow4)+
(dbo.tblsalarydetails.Allow5)
else
0 end
) as
Bonus FROM dbo.tblEmployeeMaster INNER JOIN dbo.tblsalarydetails ON
dbo.tblEmployeeMaster.empId = dbo.tblsalarydetails.EmpId WHERE (dbo.tblEmployeeMaster.projectId = @projectid)



end
GO



-- modified at 1:28 Monday 28th May, 2007


-- modified at 1:31 Monday 28th May, 2007

Magi

AnswerRe: Stored procedure probs..., Pin
Harini N K27-May-07 19:21
Harini N K27-May-07 19:21 
GeneralRe: Stored procedure probs..., Pin
Member 387988127-May-07 19:27
Member 387988127-May-07 19:27 
AnswerRe: Stored procedure probs..., Pin
Harini N K27-May-07 19:37
Harini N K27-May-07 19:37 
GeneralRe: Stored procedure probs..., Pin
Member 387988127-May-07 20:20
Member 387988127-May-07 20:20 
GeneralRe: Stored procedure probs..., Pin
Harini N K27-May-07 20:26
Harini N K27-May-07 20:26 
GeneralRe: Stored procedure probs..., Pin
Harini N K27-May-07 20:27
Harini N K27-May-07 20:27 
GeneralRe: Stored procedure probs..., Pin
Member 387988127-May-07 20:41
Member 387988127-May-07 20:41 
GeneralRe: Stored procedure probs..., Pin
Harini N K27-May-07 20:45
Harini N K27-May-07 20:45 
Questionxp_smtp_sendmail Pin
Rahul Babu27-May-07 18:43
Rahul Babu27-May-07 18:43 
AnswerRe: xp_smtp_sendmail Pin
Dave Kreskowiak28-May-07 16:46
mveDave Kreskowiak28-May-07 16:46 
QuestionWhy are some comments removed from stored procedures in SQL Server 2005? Pin
Ron Savage27-May-07 8:53
Ron Savage27-May-07 8:53 
AnswerRe: Why are some comments removed from stored procedures in SQL Server 2005? Pin
Ron Savage27-May-07 9:20
Ron Savage27-May-07 9:20 
QuestionEscape Sequences.... Pin
Polite Programmer27-May-07 1:13
Polite Programmer27-May-07 1:13 
AnswerRe: Escape Sequences.... Pin
phyomgmgwan27-May-07 2:54
phyomgmgwan27-May-07 2:54 
AnswerRe: Escape Sequences.... Pin
Giorgi Dalakishvili27-May-07 3:00
mentorGiorgi Dalakishvili27-May-07 3:00 
AnswerRe: Escape Sequences.... Pin
Colin Angus Mackay27-May-07 4:54
Colin Angus Mackay27-May-07 4:54 
AnswerRe: Escape Sequences.... Pin
Ron Savage27-May-07 8:17
Ron Savage27-May-07 8:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.