Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Howto select all entries with two fields <> value

Former Member
0 Kudos

Hi all,

I have the following SELECT stmt:

      SELECT SUM( betrw )
        INTO l_real_t
        FROM dfkkop
       WHERE opbel = l_opbel
         AND hvorg <> gc_hvorg_dun_fee
         AND tvorg <> gc_tvorg_dun_fee.

Now I get no lines, where hvorg = gc_hvorg_dun_fee OR tvorg = gc_tvorg_dun_fee.

But my intention is to get no lines, where BOTH conditions are met.

What am I doing wrong here?

Kind Regards, Matthias

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Check this..

SELECT SUM( betrw )

INTO l_real_t

FROM dfkkop

WHERE opbel = l_opbel

AND NOT ( hvorg EQ gc_hvorg_dun_fee

AND tvorg EQ gc_tvorg_dun_fee).

2 REPLIES 2

Former Member
0 Kudos

Check this..

SELECT SUM( betrw )

INTO l_real_t

FROM dfkkop

WHERE opbel = l_opbel

AND NOT ( hvorg EQ gc_hvorg_dun_fee

AND tvorg EQ gc_tvorg_dun_fee).

0 Kudos

thanks