Creating if statement to get the time in-between two dates, but if the need by date is NULL then I want to use The create date

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}))

0 2 523
2 REPLIES 2
Top Labels in this Space
Top Solution Authors