Have following:
Code:
round((cast(bp.gross_quantity as decimal(10, 2)) / 42), 2) as gross_qty
which converts gallons to barrels, in this case
537796 gallons --> 12804.670000
1. I do not understand why decimals are 6 long when I specified 2
2. Also need to convert the result (12804.670000) to a char(10) field with implicit 2 decimals embedded like 1280467
Keep in mind that quantity could be negative as well.
I tried this:
Code:
convert(char(10), round((cast(bp.gross_quantity as decimal(10, 2)) / 42), 2)) as gross_qty
but it gives overflow error
Thank you.