Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: Divide column into 2

Doonie Darkoo:

I have a table where I'm storing Allowances and Deductions. If the Basecode is 1 then it is an allowance and if BaseCode is 2 then it is deduction. I am trying to get the column transformed into 2 columns.

Allowance Deduction Something Something


SELECT (SELECT INN.FullName AS Benefit FROM [AppCNF].[tbl_AllowanceOrBenefitType] INN WHERE INN.BASECODE = 1 and INN.ID = OUTR.ID), FullName AS Deductions
FROM [AppCNF].[tbl_AllowanceOrBenefitType] OUTR
WHERE BASECODE = 2

This is what I have tried so far but it is giving NULL for Allowances.



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots


This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: Divide column into 2

×

Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription

×