Hi, we have an OTD-report (through our ERP) with 4 different dates. I simplified the names in the code.
The issue I have now:
When CONFIRMED does not have a date, but OLDCONF does -> It will not calculate the OLDCONF - SHIPMENT. How can I fix this?
And yes, this issue appears when the dates are not filled out according to the process (always first CONFIRMED), but mistakes happen.
REQDATE = Requested shipping date
CONFIRMED = Confirmed shipping date
OLDCONF = Old confirmed shipping date (if the supplier changes the date, we move the confirmed to old confirmed and renew the confirmed date)
SHIPMENT = Date when we received the shipment
if ({OLDCONF} <> date(0000,0,0) and {OLDCONF}>{CONFIRMED}) then
{CONFIRMED}-{SHIPMENT}
else if ({OLDCONF} = date(0000,0,0) and {CONFIRMED} = date(0000,0,0)) then
{REQDATE}-{SHIPMENT}
else if ({OLDCONF} = date(0000,0,0)) then
{CONFIRMED}-{SHIPMENT}
else
{OLDCONF}-{SHIPMENT}
EDIT: With this I try to get the difference in days, between REQDATE or CONFIRMED or OLDCONF date and SHIPMENT date.
The issue I have now:
When CONFIRMED does not have a date, but OLDCONF does -> It will not calculate the OLDCONF - SHIPMENT. How can I fix this?
And yes, this issue appears when the dates are not filled out according to the process (always first CONFIRMED), but mistakes happen.
REQDATE = Requested shipping date
CONFIRMED = Confirmed shipping date
OLDCONF = Old confirmed shipping date (if the supplier changes the date, we move the confirmed to old confirmed and renew the confirmed date)
SHIPMENT = Date when we received the shipment
if ({OLDCONF} <> date(0000,0,0) and {OLDCONF}>{CONFIRMED}) then
{CONFIRMED}-{SHIPMENT}
else if ({OLDCONF} = date(0000,0,0) and {CONFIRMED} = date(0000,0,0)) then
{REQDATE}-{SHIPMENT}
else if ({OLDCONF} = date(0000,0,0)) then
{CONFIRMED}-{SHIPMENT}
else
{OLDCONF}-{SHIPMENT}
EDIT: With this I try to get the difference in days, between REQDATE or CONFIRMED or OLDCONF date and SHIPMENT date.