1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Writing CASE statement with Multiple conditions

Discussão em 'Outras Linguagens' iniciado por Stack, Janeiro 30, 2021.

  1. Stack

    Stack Membro Participativo

    I want to sum amount minus calc_amount. For example: There are 3 columns; date, amount and calc_amt.

    > ID Date Amount Calc_amt
    >
    > 1 24th Jan 25.78 0
    >
    > 1 18th Feb 25.78 25.78


    For 24th Jan date in Amount 25.78 and Calc_amt is 0. In 18th feb date in amt 25.78 and Calc_amt is also 25.78 so sum will be 0 because amt is cleared on 18th date. There could be 14th date data also with same kind of conditions.

    amt value will be carry forward to next date If Calc_amt is 0.

    Expected o/p is : null

    Will case statement work here or any other function? how to write this condition? Thanks a lot

    Continue reading...

Compartilhe esta Página