<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SQL Server, SQL Server Express, and SqlDataSource Control</title><link>http://forums.asp.net/54.aspx</link><description>All about SQL Server, SQL Server Express, MSDE, and the SqlDataSource control.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Check for NULL in CASE</title><link>http://forums.asp.net/thread/1291115.aspx</link><pubDate>Fri, 19 May 2006 19:27:30 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1291115</guid><dc:creator>cubeberg</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1291115.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=54&amp;PostID=1291115</wfw:commentRss><description>&lt;p&gt;Have you considered using Coalesce?&amp;nbsp; Coalesce(Note1 + DrAccount, Location + DrAccount)&lt;/p&gt;
&lt;h1&gt;&lt;a name=_coalesce&gt;&lt;/a&gt;&lt;font size=3&gt;COALESCE&lt;/font&gt;&lt;/h1&gt;
&lt;p&gt;Returns the first nonnull expression among its arguments.&lt;/p&gt;
&lt;h5&gt;Syntax&lt;/h5&gt;
&lt;p&gt;COALESCE &lt;b&gt;( &lt;/b&gt;&lt;i&gt;expression&lt;/i&gt; [ &lt;b&gt;,&lt;/b&gt;&lt;i&gt;...n &lt;/i&gt;] &lt;b&gt;) &lt;/b&gt;&lt;/p&gt;</description></item><item><title>Check for NULL in CASE</title><link>http://forums.asp.net/thread/1291089.aspx</link><pubDate>Fri, 19 May 2006 18:53:40 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1291089</guid><dc:creator>sunstar</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1291089.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=54&amp;PostID=1291089</wfw:commentRss><description>&lt;font face=Tahoma color=#000080&gt;SELECT whatever_field, &lt;br /&gt;CASE LEN(DrAccount) &lt;br /&gt;&amp;nbsp;&amp;nbsp;WHEN 12 THEN DrAccount &lt;br /&gt;&amp;nbsp;&amp;nbsp;ELSE CASE (Note1) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;WHEN NULL THEN Location + DrAccount &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ELSE Note1 + DrAccount &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;END &lt;br /&gt;&amp;nbsp;&amp;nbsp;END AS Account &lt;br /&gt;FROM Table1 &lt;br /&gt;&lt;br /&gt;The purpose of the CASE(Note1) is when Note1 column is null, return Location+DrAccount. &lt;br /&gt;&lt;br /&gt;The actual result is when Note1 column is null, it always returns null, Location+DrAccount is not executed. When Note1 column is not null, it returns correctly Note1+DrAccount. &lt;br /&gt;&lt;br /&gt;The problem seems to reside in validating the null value in &lt;br /&gt;WHEN NULL &lt;br /&gt;&lt;br /&gt;How to check for null in CASE(fieldname) WHEN ??? &lt;/font&gt;</description></item></channel></rss>