Using IF statement to select a delivery date?

SOLVED

Hello,

I have a Sales Order confirmation form set up so that each line on the order can show its own delivery date. This calls on SOP_ITEM.DUE_DATE and has to be manually input.

Should any line contain a blank SOP_ITEM.DUE_DATE then I want to be able to call on SALES_ORDER.DESPATCH_DATE to populate the field.

I have thought about using the IF statement in an expression but I'm not sure if this is the way to go.

Could somebody assist me please with the correct syntax?

many thanks

Andy