SQL Language (MOSC)

MOSC Banner

On Time Delivery calculation

edited Mar 4, 2010 11:47AM in SQL Language (MOSC) 6 commentsAnswered ✓
Hi All,

How can i to write the coding as below expectation:

Conditions:
----------------

a.) Shedule Ship Date - Actual Shipment > 0 Then "Failded OTD"

b.) Shedule Ship Date - Actual Shipment <= 0 Then "Pass OTD OTD"

c.)  If actual shipment date is null, then "Not Yet Deliver"

d.) Days variance : Shedule Ship Date - Actual Shipment

SQL Command: 
----------------------


SELECT
case when (trunc(schedule_ship_date) - to_date(ool.actual_shipment_date,'DD-MON-YY')) < 0 then 'FAILED'
                      else 'PASS' end as "OTD"
 ,trunc(schedule_ship_date) - to_date(ool.actual_shipment_date,'DD-MON-YY') "DAYS VARIANCE"
From  oe_order_lines_all ool

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center