Converting MB to GB

  • SELECT ISNULL(SUM(CAST(hsi.itemdatapage.filesize AS BIGINT)),0)/1024/1024 AS Storage

    This give me back MB. If I try to add another /1024, it blows up. WHy?

  • Try / 1024.0 (any of them).

    That will convert to decimal so that you don't get 0 when it's less than 1.

  • Yep that worked, thanks. Hmm, less than one...learn something new every day...

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply