We help IT Professionals succeed at work.
Get Started

SQL CASE ANOTHER COLUMN OF ANOTHER  ROW

137 Views
Last Modified: 2015-04-27
Dears

Im trying to case a column to use the sum of M_DR + M_CR as the CLS_BAL. E,g if the ID is 192000801 then it should have the sum of M_DR and M_CR of ID 1920008      as its CLS_BAL as I have made in bold below.

Attach is a sample of the data I am working with.

SHEET              CAT              H_ID      ID                      CHRT_ID              OPN_BAL            M_DR                    M_CR             CLS_BAL
BALANCE      ASSETS      10122      1920008              1920008              0.00                            3000.00      0.00                     0.00
BALANCE      ASSETS      10125      192000801      192000801      0.00                      0.00                            0.00                    3000.00
BALANCE      ASSETS      10117      1930002              1930002              20847369.45            0.00                            403436.43     21250805.88
BALANCE      ASSETS      10125      193000201      193000201      0.00                            0.00                            0.00                     0.00
EE-SAMPLE-0427.xlsx
Comment
Watch Question
"Batchelor", Developer and EE Topic Advisor
CERTIFIED EXPERT
Top Expert 2015
Commented:
This problem has been solved!
Unlock 1 Answer and 8 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE