February 21, 2012 at 11:20 pm
Hi all
following Query
SELECT EmpName As EName
IF (BasicPay>5000, "OVER","lOW"), AS Result
FROM EmpSalary
The Result is following in Error
Line 2: Incorrect syntax near ','.
hope somebody help me
Thanks
February 21, 2012 at 11:33 pm
Use Case statment
SELECT EmpName As EName
case when BasicPay>5000 then 'OVER else 'lOW' end AS Result
FROM EmpSalary
February 21, 2012 at 11:54 pm
Use Case statment
SELECT EmpName As EName
case when BasicPay>5000 then 'OVER else 'lOW' end AS Result
FROM EmpSalary
Its also not working
Incorrect syntax near the keyword 'case'.
February 22, 2012 at 1:32 am
iamidress (2/21/2012)
Use Case statmentSELECT EmpName As EName
case when BasicPay>5000 then 'OVER else 'lOW' end AS Result
FROM EmpSalary
Its also not working
Incorrect syntax near the keyword 'case'.
Just a comma and an apostrophe missed off:
try this:
SELECT EmpName As EName,
case when BasicPay>5000 then 'OVER' else 'lOW' end AS Result
FROM EmpSalary
February 22, 2012 at 2:18 am
many many Thanks
Its Working
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply