ASPForums.Net RSS Feed additions to the content that appears on ASPForums.Net(c) 2019 All rights reserved.Determine Length of Column and assign value using Case statement in SQL Server<p>Hi <a class="username" rel="phonghue"> phonghue</a>,</p> <p>Check this example. </p> <p><strong><span style="text-decoration: underline;">SQL</span></strong></p> <pre class="brush: sql">SELECT PROGRAMS.AutoNum, PROGRAMS.OrgCode, PROGRAMS.OPAcadYearOnly, CASE WHEN LEN(PROGRAMS.OPPubDescrip) &gt; 400 THEN 2 ELSE 1 END AS number, PROGRAMS.OPMissionS FROM ORGANIZATIONS INNER JOIN PROGRAMS ON ORGANIZATIONS.OrgCode = PROGRAMS.OrgCode WHERE ORGANIZATIONS.Status = &#39;Approved&#39; AND PROGRAMS.OPStatus = &#39;Active&#39; ORDER BY ORGANIZATIONS.OrgCode</pre> <p>&nbsp;</p>, 13 Aug 2019 07:32:50 GMT