Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8533

Re: Query for outstanding order

$
0
0

Thanks for your reponse

 

SELECT T1.[ItemCode], T1.[U_EA_Packgroup], T1.[Dscription], T2.[CardName], T2.[DocNum], T2.[DocDate], T2.[NumAtCard], T2.[TaxDate], T1.[U_EA_Case], sum(T0.[U_EA_Case]) as 'Delivered'

FROM DLN1 T0

INNER JOIN RDR1 T1 ON T0.BaseEntry = T1.DocEntry AND T0.BaseLine = T1.LineNum

INNER JOIN ORDR T2 ON T1.DocEntry = T2.DocEntry

Group by T1.[ItemCode], T1.[U_EA_Packgroup], T1.[Dscription], T2.[CardName], T2.[DocNum], T2.[DocDate], T2.[NumAtCard], T2.[TaxDate], T1.[U_EA_Case]

 

Used, this code.

 

1) Now I not getting sales orders with none being delivered. The output of the query is list of items with atleast 1no(case) being delivered.


2) I need all Open Sales orders, I tried adding T2.[LineStatus] = 'O' before Group By but its not executing


3) Also, I need to bring abt the balance qty (Ordered cases - Delivered cases)

 

How to bring about?


Viewing all articles
Browse latest Browse all 8533

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>