I have this so far. I want to find the number of days between the need by date and the receipt date, but if the need by date is NULL then I want to use the create date. What am I getting wrong?
if(${orders.need_by_date}=null,diff_days(${orders.created_date},now()),diff_days(${orders.need_by_date},${receipts.receipt_created_date}))
In SQL you can’t equate to null instead you should write as ${orders.need_by_date} is null
And in the table calculation you need to use is_null() function