IFF and IsNull

 

Use of the Format function in a SELECT will cause you to lose rows in your results if the value you are formatting is NULL.

 

Using IsNull function and IIF construct in MS Access

 

FORMAT(IIF(IsNull (O.Tax),0,O.Tax),"Currency") as TAX

 

Syntax for MS SQL

Coalesce could also be used in place of IsNull below.

 

CAST(IsNull(TAX,0)AS money) as TAX