I am new to this site, so sorry if I sound like a newb. I have found some good answers to stuff on this site, and I like it!
Here is my current dilemma:
I am storing a bigint value (for file sizes) in a table. I need to group on one column and for the filesizes (which are in bytes) I would like to have a column showing them by GB. This would mean Sum(FileSize/1024/1024/1024) which is not showing any decimal places. My research seems to indicate this may be due to trucation rather than rounding.
I have tried many options of casting and converting, but cannot seem to find any information about how to sum and divide a bigint, and maintain the decimals. If I take the sum and divide it in Excel, I get the decimals, which tells me there has to be a way to do this in SQL.
Any help is appreciated.