0

SELECT T1.[AcctCode],T1.[AcctName] FROM OACT T1

I need T1.AcctName as operating cost if T1.AcctCode like 61 Please help me to get this thing.

2
  • Are you searching for case statement? Commented Dec 4, 2015 at 9:02
  • will be better. but issue should be solved, either with if or case . @AndyKorneyev Commented Dec 4, 2015 at 9:04

2 Answers 2

1

Use CASE

SELECT T1.[AcctCode],
       AcctName = CASE WHEN T1.[AcctCode] = 61 
                       THEN 'operating cost' 
                       ELSE T1.[AcctName]
                  END
FROM OACT T1
Sign up to request clarification or add additional context in comments.

Comments

0
SELECT T1.AcctName AS operating cost FROM OACT T1 WHERE T1.AcctCode=61

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.