title: Adding a value to a datetime column caused an overflow
body: <p>Getting this error:</p>
  
  <blockquote>
    <p>Adding a value to a 'datetime' column caused an overflow.</p>
  </blockquote>
  
  <pre><code>CASE U.BasePool 
              WHEN 0 THEN 'N/A'
              WHEN -1 THEN 'N/A'
              ELSE CASE 
                      WHEN SUM(SUM(B.TransactionCount)) OVER (Partition by U.ContractID) &gt; U.BasePool THEN 'IN-OVERAGE'
                      --WHEN SUM(SUM(B.TransactionCount)) OVER (Partition by U.ContractID) + (SUM(SUM(B.TransactionCount))  OVER (Partition by U.ContractID)/MonthNum) &gt; U.BasePool THEN DATEADD(MM, 1, GETDATE())
                      ELSE  CASE WHEN MonthNum&lt;1 THEN NULL ELSE CONVERT(VARCHAR(20),DATEADD(MM,CAST(ROUND((U.BasePool - SUM(SUM(B.TransactionCount))  OVER (Partition by U.ContractID)) 
                                  /(SUM(SUM(B.TransactionCount))  OVER (Partition by U.ContractID)/MonthNum),0) as Int), GETDATE()),101)
  
                      --(basepool - sumcontract) / (sumcontract/monthNum ) is the expected months to reach overage
                  END 
              END
              END AS  ExpectedDate
  </code></pre>