Lynn Emery

Lynn Emery

  • NA
  • 47
  • 56.3k

Numbers after decimal place not showing.

Feb 18 2013 6:06 AM
Hi,
I have a problem with displaying numbers after a decimal place in my SQL statement.
For example if I was to calculate 125/511 * 1000 my sql statement would present the answer as 244.00 rather than 244.62.

My sql statement is as follows:

CAST(SUM(Refunds) / SUM(sales) * 1000 AS DECIMAL(9, 2))

Please note that 'Refund' and 'Sale' data also have a decimal (9,2) data format, as I initially thought that data type inconsistency may have been causing the issue.

I welcome your suggestions and thank you for your help.

Answers (3)