title: COALESCE, IFNULL, or NZ() function that can be used in SQL Server and MS Access
body: <p>I have a project that can use either SQL Server or MS Access as the data store.   In one SELECT statement, I must perform a COALESCE operation on a single column and a single value, like this:</p>
  
  <pre><code>SELECT COALESCE([Amount], 0) FROM PaymentsDue;
  </code></pre>
  
  <p>I would like to write a single SQL statement that will execute correctly in both SQL Server and MS Access.  The SQL Server version that is of immediate interest is 2008, although a solution applicable across versions would be preferred.</p>
  
  <p>Earlier today, someone was able <a href="https://stackoverflow.com/questions/7904530/cast-for-format-a-datetime-to-date-on-both-sql-server-and-ms-access">to show me an SQL trick</a> that allowed me to use a single SELECT statement to effectively CAST a DATETIME to DATE.  I was wondering if anyone has a similar trick to perform a COALESCE (eg, IFNULL or NZ) operation in a way that can be applied to <em>both</em> SQL Server and MS Access?</p>