title: Transact SQL - Is it possible to SUM () without GROUP BY
body: <p>I have the following code (see below).
  Is it possible to re-write it, in the way - to avoid using</p>
  
  <p><strong>Group By</strong> statement</p>
  
  <p>Please see below:</p>
  
  <pre><code>DECLARE @MonthBOP date = '07-01-2017'
  DECLARE @MonthEOP date = '02-28-2018'
  DECLARE @GLRegionsWHID int = -1
  
  SELECT
   e.[GLRegion]
  ,e.[GLRegionWHID]
  ,e.[GLProgram]
  ,e.[GLProgramWHID] 
  ,e.[DOLStatus] 
  ,e.[DOLStatusWHID]
  ,e.[TerminationType]
  ,e.[TerminationReason]
  
   ,SUM(IIF((e.[DateHired] &lt;= @MonthBOP) AND (e.[DateTerminated] &gt;= @MonthBOP), 1, 0)) AS [CountEmployeesBOP]
  ,SUM(IIF((e.[DateHired] &lt;= @MonthEOP) AND (e.[DateTerminated] &gt;= @MonthEOP), 1, 0)) AS [CountEmployeesEOP]
  ,SUM(IIF(e.[DateTerminated] BETWEEN @MonthBOP AND @MonthEOP, 1, 0)) AS [CountTerminations]
  
  FROM 
      [Reports].[vPaycomEmployee] e
  
  WHERE
      ((e.[DateHired] &lt;= @MonthEOP) OR (e.[DateTerminated] &gt; @MonthBOP)) 
  AND ((e.[GLRegionWHID] IN (@GLRegionsWHID)) OR (-1 IN (@GLRegionsWHID)))
  
  
  GROUP BY
   e.[GLRegion]
  ,e.[GLRegionWHID]
  ,e.[GLProgram]
  ,e.[GLProgramWHID] 
  ,e.[DOLStatus] 
  ,e.[DOLStatusWHID]
  ,e.[TerminationType]
  ,e.[TerminationReason]
  
  HAVING
  (SUM(IIF((e.[DateHired] &lt;= @MonthBOP) AND (e.[DateTerminated] &gt;= @MonthBOP), 
       1, 0)) &gt; 0)
  </code></pre>
  
  <p>I need to avoid Group By because it affects the resulting calculations</p>