cancel
Showing results for 
Search instead for 
Did you mean: 

SQl Report - Sales Orders closed today

Former Member
0 Kudos

Hi All

in our business, it may take multiple deliveries before a Sales Order is completed and closed. I've managed to write the following query (with my limited skills) but it would only appear to pick up a Sales Order that is closed when delivered in full by a single delivery....

SELECT T0.[DocNum], T0.[CardCode], T0.[CardName],T0.[UpdateDate] AS 'Closed On' FROM ORDR T0 WHERE T0.[DocStatus] ='C' AND T0.[UpdateDate] >= GETDATE () - 4

I want to be able to produce a report that is triggered when the Sales Order is closed as a result of the last delivery to close that order.

Could anyone assist please?

Many thanks

Derek

Accepted Solutions (0)

Answers (2)

Answers (2)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Please check this thread https://archive.sap.com/discussions/thread/3631338

Regards,

Nagarajan

0 Kudos

Hi Derek,

It seems you want to know last delivery date against sales order.

You can make join with Delivery (ODLN & DLN1) by baseentry and baseline and find max delivery date by group by and having clause.

Regards,

Zuber Kazi