troubleshooting Question

Convert Byte to MB or GB

Avatar of anthonytr
anthonytrFlag for United Kingdom of Great Britain and Northern Ireland asked on
Microsoft AccessMicrosoft SQL ServerSQL
20 Comments3 Solutions7309 ViewsLast Modified:

I have an application which outputs file data into a database as each file is created.  The data which is added to the database is the file size in (Bytes).  I run regular queries and report which add these fields up and give me a total size of all the documents which have been created.  Obviously, it just adds up the BYTE field so that I end up with a huge figure.  How can I then convert this figure into either MB or GB.  I understand that:

for MB it is bytes/(1024*1024)
for GB is it bytes/(1024*1024*1024)

I'm getting nowhere with this.  

Get vaccinated; Social distance; Wear a mask
Join our community to see this answer!
Unlock 3 Answers and 20 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 20 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros