Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Howto select all entries with two fields <> value

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

Tags:
Former Member
Former Member replied

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 View this answer in context
Not what you were looking for? View more on this topic or Ask a question