SELECT orderhed.ordernum, orderhed.orderdate, currrate.currencycode,
case(currrate.currentrate) when null then 1 else currrate.currentrate end
FROM orderhed LEFT OUTER JOIN currrate ON orderhed.company = currrate.company AND orderhed.orderdate = currrate.effectivedate