Dear member,
i need your help in Query / FMS:
Customer needs to set the delivery date in delivery note lines (DLN1) via FMS.
| Weekday | ShipDay |
|---|---|
| Thursday | Friday |
| Friday | Monday |
| Saturday | Monday |
| Sunday | Monday |
Delivery date has to refresh when add/change ItemCode by hand or coming from pick & pack as manual delivery note.
I need to finish my query with your help:
SELECT CASE
WHEN DATEPART (dw, GETDATE())= 6 THEN DATEADD (dd, 4,T0.ShipDate)
WHEN DATEPART (dw, GETDATE())= 7 THEN DATEADD (dd, 3, T0.ShipDate)
ELSE DATEADD (dd,1,T0.ShipDate)
END
FROM DLN1 T0