Query to convert from MB into a GB value
<p>I am trying to get results from a query that gives me the result from the column Filesize. That value from Filesize was converted at the begging to a MB value and now I want do do a query that convert that value into a GB value. This is the query that I am using right now</p>

<pre><code>SELECT 
CAST(SUM(Filesize) / 1024 AS DECIMAL(10,2)) 
FROM infofile
</code></pre>

<p>If you could help I would appreciate it </p>

<p>If I use the query </p>

<pre><code>SELECT 
    SUM(FILESIZE)
    FROM infofile
</code></pre>

<p>the value that I will get it '1326278' and if I divide it by 1024 gives me 1295(MB) and I want to get it in GB and it will gives me with this query </p>

<pre><code>    SELECT 
CAST(SUM(Filesize) / 1024 / 1024 AS DECIMAL(10,2))
FROM infofile 
</code></pre>

<p>1.00</p>