Skip to Content
author's profile photo Former Member
Former Member

Query Hilfe - Items Onhand über 0 - aber keine offenen Aufträge

Hallo,

ich bastle gerade an einer Abfrage, die zeigen soll:

alle Artikel, der Bestand (onHand) größer 0 ist, und die aber in keinen offenen Kundenauftrag stehen.

SELECT T0.[ItemCode] FROM OITM T0 
WHERE T0.[OnHand] > '0' and not exists (Select t1.ItemCode from RDR1 T1 where T1.LineStatus = 'o')

bei mir kommt "... keine Daten gefunden"

Ein manueller Abgleich (in Excel) der Daten der ersten Abfrage mit der zweiten brachte mir jedoch die Artikel, die Bestand haben, es aber aktuell keinen Kundenauftrag für gibt.

Kann jemand helfen ?

Vielen Dank für Eure Wissenswerte

Gruß

Markus

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 12, 2013 at 01:42 PM

    die Information hast du auch in der OITM Tabelle.

    SELECT T0.[ItemCode], T0.[ItemName], T0.[OnHand], T0.[IsCommited] FROM OITM T0

    WHERE T0.[IsCommited] < 1 and T0.[OnHand] > 0

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2013 at 07:35 AM

    Ich habe das so verstanden: Artikelliste von Artikeln, die Bestand haben, aber keine offenen Aufträge.

    Falls ja, hier die Lösung:

    select itemcode, itemname, onhand from oitm where itemcode not in (select itemcode from rdr1 where linestatus = 'O') and onhand > 0

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.