John Nelson (MVP ConfigMgr) has turned out a really cool SQL query, which converts a byte value in to a given unit of measure such as MB or GB. This is useful if you want to express a byte value in GB form for example.

If you write SQL queries for your ConfigMgr reports, this is one useful function to have.

Check it out here: http://myitforum.com/cs2/blogs/jnelson/archive/2009/07/06/139462.aspx

Another query from John that I used recently was to convert Bytes in to a human readable form (whatever the byte value represents, MB, GB etc), this one is dynamic and turns out KB, MB or GB values so you don't get to choose the resulting unit of measure.

Check it out here: http://myitforum.com/cs2/blogs/jnelson/archive/2008/01/11/111351.aspx