Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to splitProjects in one column in sql sever 2008
    text
    copied!<pre><code>WITH MYTABLE AS ( select Executive, count([Cat A]) AS [1-3], count([Cat B]) AS [4-6],count([Cat C]) AS [7-10],count([Cat D]) AS [11-15],count([Cat E]) AS [16+] from ( select Executive, case when [Next Follow Up Date] &lt; GETDATE() and (DATEDIFF(d,[next follow up date],getdate()) &gt; 0 and DATEDIFF(d,[next follow up date],getdate()) &lt; 4) then 'A' end as [Cat A], case when [Next Follow Up Date] &lt; GETDATE() and (DATEDIFF(d,[next follow up date],getdate()) &gt; 3 and DATEDIFF(d,[next follow up date],getdate()) &lt; 7) then 'B' end as [Cat B], case when [Next Follow Up Date] &lt; GETDATE() and (DATEDIFF(d,[next follow up date],getdate()) &gt; 6 and DATEDIFF(d,[next follow up date],getdate()) &lt; 11) then 'C' end as [Cat C], case when [Next Follow Up Date] &lt; GETDATE() and (DATEDIFF(d,[next follow up date],getdate()) &gt; 10 and DATEDIFF(d,[next follow up date],getdate()) &lt; 16) then 'D' end as [Cat D], case when [Next Follow Up Date] &lt; GETDATE() and (DATEDIFF(d,[next follow up date],getdate()) &gt; 15) then 'E' end as [Cat E] from vw_FollowUps) as Table1 group by Executive, [Cat A], [Cat B], [Cat C], [Cat D], [Cat E] ) Select T1.Executive, SUM([1-3]) AS [1-3],SUM([4-6]) AS [4-6],SUM([7-10]) AS [7-10],SUM([11-15]) AS [11-15],SUM([16+]) AS [16+] from MYTABLE T1 GROUP BY T1.Executive </code></pre> <hr> <pre><code>i got output below Executive 1-3 4-6 7-10 11-15 16+ kushali 1 2 0 1 2 nirupama 0 1 1 3 1 </code></pre> <hr> <p>but i need output below -here i want projects column and how we have to split projects in one column</p> <pre><code>Executive Projects 1-3 4-6 7-10 11-15 16+ kushali swgruha,runi,nanuapa 1 2 0 1 2 nirupama swgruha,runi,nanuapa 1 2 0 1 2 </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload