Hi Larry,
>This would require two passes through the data. One to get the intermediate table data and another to set replace the NULL values. NVL() would handle it in one pass. Both Oracle and SQL Server have this function to handle the same problem.
you're right! I was mislead by the phrase "IIF is not working". So I thought, if IIF isn't working in the LEFT JOIN, so NVL() wouldn't also. So I did a test now, and IIF *is* working ... But NVL() is the more elegant solution, of course.
Thanks for the clarification!
Armin