0

I am using either:

CAST( SUM(a.fieldmissed) AS decimal(18,8)) / SUM(a.fieldtotal) *100 AS [Deliveries Missed]

or

SUM(a.fieldmissed)*100.0 / SUM(a.fieldtotal) AS [Deliveries Missed]

to work out % values. However, is there a way I can restrict the output to two decimal places? Not essential but would be handy to know.

Any advice appreciated. Thanks very much.

Abdul Rasheed
  • 6,486
  • 4
  • 32
  • 48
Will F
  • 417
  • 2
  • 6
  • 17

1 Answers1

0

You can use CONVERT(DECIMAL(18,2),value) to convert the value to 2 decimal or use ROUND(value,2) to round the value to 2 decimal.

Abdul Rasheed
  • 6,486
  • 4
  • 32
  • 48