Nathan DeWitt Nathan DeWitt - 25 days ago 26
SQL Question

coalesce alternative in Access SQL

In T-SQL, you can do this:

SELECT ProductId, COALESCE(Price, 0)
FROM Products


How do you do the same thing in Access SQL? I see examples for doing it with Nz in VBA, but I'm looking for the SQL equivalent.

Thanks.

Answer

Access supports the Nz function and allows you to use it in a query. Note though that Nz is the same as the T-SQL ISNULL function. It can not take an arbitary number of parameters like COALESCE can.

Comments