Hi federicomarinuci,
Thanks for replying to my post.
I could modify the stored procedure to the following:
ALTER PROCEDURE [dbo].[spGetCustomerServic
AS
SELECT metric_id, description, metric =
CASE metric_id
WHEN 1 THEN CAST(metric AS VARCHAR(2)) + '%'
WHEN 2 THEN CAST(metric AS VARCHAR(10)) + ' seconds'
WHEN 3 THEN CAST(metric AS VARCHAR(2)) + '.0'
ELSE CAST(metric AS VARCHAR(10))
END
FROM dbo.customer_service_metri
But, the problem with that is the record will change in the next quarter to possibly 8.2 or someother decimal value, then it would display as 8.2.0 and then would not be good.
Is there a better way to correct this?
Main Topics
Browse All Topics





by: federicomarinucciPosted on 2009-10-23 at 07:26:35ID: 25644744
That's the way SQL uses to store its real values, and it's correct.
You may want to have 8.0 just for display purposes, so, when you SELECT these values, you may add ".0" by code or by a CASE sql statement where the rest of VALUE / 1.0 equals 0.