If ((IsNull(DSLink2.DUNS_LEVEL_1) =0) And (IsNull (DSLink2.DUNS_LEVEL_2) = 0) And (IsNull( DSLink2.DUNS_LEVEL_3) =1)) Then DSLink2.LEGACY_CD Else DSLink2.DUNS_LEVEL_3 .
In the above query it checks that if my first level is not null and my second level is not null and my third level is null, it populates the required field in the third level. Is the above query right?. for eg
level1 level2 level3
1234 2545 null
then output should be
level1 level2 level3
1234 2545 7894 if dslink.legacy_cd=7894.