title: Add values of 2 calculated fields in a view to make a 3rd calculated column
body: <p>I'm working on a view for our Mobile Device Management system that collects cellular data usage in Bytes. I have a CONVERT function that convers the Download and Upload from Bytes to GB as 2 extra columns. There's no total column and I don't need the total in Bytes, but what I do need is the Total in GB. So I'm trying to add together the contents of the calculated &quot;Download (GB)&quot; and &quot;Upload (GB)&quot; for each row.</p>
  <p>The View's SQL code is as follows (I've formatted it to make it look hopefully a bit more readable)</p>
  <pre><code>SELECT
  dbo.DevInfo.DevId,
  dbo.DevInfo.DevName,
  dbo.AndroidWorkProduct.Title,
  dbo.DeviceStatNetTraffic.Application,
  dbo.DeviceStatNetTraffic.TimeStamp,
  dbo.DeviceStatNetTraffic.Upload,
  dbo.DeviceStatNetTraffic.Download,
  dbo.DevInfo.LastCheckInTime,
  dbo.Person.LoginName,
  dbo.Person.FirstName,
  dbo.Person.MiddleName,
  dbo.Person.LastName,
  dbo.DeviceGroup.Name,
  dbo.DevInfo.Model,
  dbo.DevInfo.Manufacturer,
  dbo.DevInfo.OSVersion,
  dbo.DevInfo.PhoneNumber,
  dbo.Person.CustomProperty1,
  dbo.Person.CustomProperty2,
  CONVERT(DECIMAL(10, 2), dbo.DeviceStatNetTraffic.Upload / 1024 / 1024 / 1024) AS [Upload (GB)],
  CONVERT(DECIMAL(10, 2), dbo.DeviceStatNetTraffic.Download / 1024 / 1024 / 1024) AS [Download (GB)]
  FROM           
  dbo.DeviceStatNetTraffic
  WITH (NOLOCK) INNER JOIN dbo.DevInfo WITH (NOLOCK) ON dbo.DeviceStatNetTraffic.DeviceId = dbo.DevInfo.DeviceId
  INNER JOIN dbo.Person ON dbo.DevInfo.CurrentPersonId = dbo.Person.PersonId
  INNER JOIN dbo.DeviceGroupDevice ON dbo.DevInfo.DeviceId = dbo.DeviceGroupDevice.DeviceId
  INNER JOIN dbo.DeviceGroup ON dbo.DeviceGroupDevice.DeviceGroupId = dbo.DeviceGroup.DeviceGroupId
  INNER JOIN dbo.AndroidWorkProduct ON dbo.DeviceStatNetTraffic.Application = dbo.AndroidWorkProduct.AndroidProductId
  </code></pre>
  <p>The lines performing the conversion are:</p>
  <pre><code>CONVERT(DECIMAL(10, 2), dbo.DeviceStatNetTraffic.Upload / 1024 / 1024 / 1024) AS [Upload (GB)],
  CONVERT(DECIMAL(10, 2), dbo.DeviceStatNetTraffic.Download / 1024 / 1024 / 1024) AS [Download (GB)]
  </code></pre>
  <p>I've tried things like:</p>
  <pre><code>SUM('Upload (GB)' + 'Download (GB)') AS [Total (GB)]
  
  SUM(dbo.custom_datausage.'Upload (GB)' + dbo.custom_datausage.'Download (GB)') AS [Total (GB)]
  </code></pre>
  <p>But neither work. I've done some investigation on summing or adding together 2 calculated fields but I couldn't really understand it as SQL isn't my area of expertise or my day job. Also the examples looked more tailored to queries being run rather than views that other systems will pull from.</p>
  <p>Any help in being able to get a Upload (GB), Download (GB) and Total (GB) set of columns would be much appreciated.</p>
  <p>Here is an example of the current output with any PII (person information) removed:</p>
  <pre><code>+----------------------------------------------------+------------------------------+-------------------------+------------+------------+-------------------------+-----------+--------------+-----------+-------------+---------------+
  |                       Title                        |         Application          |        TimeStamp        |   Upload   |  Download  |     LastCheckInTime     |   Model   | Manufacturer | OSVersion | Upload (GB) | Download (GB) |
  +----------------------------------------------------+------------------------------+-------------------------+------------+------------+-------------------------+-----------+--------------+-----------+-------------+---------------+
  | Microsoft SharePoint                               | com.microsoft.sharepoint     | 2020-11-09 12:00:35.263 |   28942282 | 2926094789 | 2021-04-22 09:48:05.000 | SM-T515   | samsung      |        10 | 0.00        | 2.00          |
  | Microsoft SharePoint                               | com.microsoft.sharepoint     | 2020-11-06 14:00:01.137 |   16001723 | 2494834025 | 2021-04-22 09:50:03.000 | SM-T515   | samsung      |        10 | 0.00        | 2.00          |
  | Google Chrome: Fast &amp; Secure                       | com.android.chrome           | 2020-11-20 18:00:00.777 |    7337215 | 2725987798 | 2021-04-22 03:47:28.000 | SM-A515U  | samsung      |        10 | 0.00        | 2.00          |
  | Google Chrome: Fast &amp; Secure                       | com.android.chrome           | 2020-12-15 18:00:59.257 |  529663816 | 2652521085 | 2021-04-22 09:49:36.000 | SM-A715F  | samsung      |        10 | 0.00        | 2.00          |
  | Microsoft Outlook: Secure email, calendars &amp; files | com.microsoft.office.outlook | 2021-02-10 22:00:19.053 |  524582841 | 3007983510 | 2021-04-22 09:34:35.000 | SM-J330FN | samsung      |         9 | 0.00        | 2.00          |
  | ZOOM Cloud Meetings                                | us.zoom.videomeetings        | 2021-02-15 12:00:41.577 | 1438142679 | 2300425438 | 2021-04-22 09:46:07.000 | SM-A705FN | samsung      |        10 | 1.00        | 2.00          |
  | Google Chrome: Fast &amp; Secure                       | com.android.chrome           | 2021-02-15 12:00:41.597 |  131430179 | 2110910408 | 2021-04-22 09:46:07.000 | SM-A705FN | samsung      |        10 | 0.00        | 1.00          |
  | Google Chrome: Fast &amp; Secure                       | com.android.chrome           | 2020-11-17 18:00:01.670 |   16605803 | 2496396859 | 2021-04-22 09:50:25.000 | SM-A515U  | samsung      |        10 | 0.00        | 2.00          |
  +----------------------------------------------------+------------------------------+-------------------------+------------+------------+-------------------------+-----------+--------------+-----------+-------------+---------------+
  </code></pre>