SSIS - IF AND STATEMENT

93 views Asked by At

how can this if and statement be written in derived column.

IF(AND(AD2>-1,AD2<16),"0-15 Days",(IF(AND(AD2>15,AD2<31),"15-30 Days",(IF(AND(AD2>30,AD2<91),"30-90 Days",(IF(AD2>90,"90+Days",AD2)))))))

how can this be written in derived column

2

There are 2 answers

0
Roshan Nuvvula On

I don't have SSIS Installed in my Machine. So didn't tried. But you can write something like this

IF(AND(AD2>-1,AD2<16),"0-15 Days",(IF(AND(AD2>15,AD2<31),"15-30 Days",(IF(AND(AD2>30,AD2<91),"30-90 Days",(IF(AD2>90,"90+Days",AD2)))))))

AD2>-1 && AD2<16 ? "0-15 Days" : (AD2>15 && AD2<31 ? "15-30 Days" : (AD2>30 && AD2<91 ? "30-90 Days" : ( AD2>90 ? "90+Days" : AD2)))
0
tinazmu On

If your column is called AD2 then:

AD2>-1 && AD2<16 ? "0-15 Days" : AD2<31 ? "15-30 Days" : AD2<91 ? "30-90 Days" : "90+Days"