Discussion:
Formating
(too old to reply)
Les
2007-11-13 11:41:01 UTC
Permalink
I have created a view with in SQL Server 2005.

Is there a way to format the columns so that they are in a percentage format?
How about a comma?

Here is an example of my view. I would like to make
"dbo.Prog_Info.Retained_QS"
in comma format and "dbo.Prog_Info.XS_Rate" in percentage format.


SELECT dbo.F1_Data.Reserve_Category, dbo.F1_Data.Accounting_Name,
dbo.F1_Data.Company, dbo.F1_Data.MCO_PCO, dbo.F1_Data.ASL,
dbo.F1_Data.Year, dbo.Prog_Info.INDEX1, dbo.Prog_Info.Retained_QS,
dbo.Prog_Info.XS_Rate

FROM dbo.Current_Eval_Date INNER JOIN
dbo.F1_Data ON dbo.Current_Eval_Date.Eval_Dt =
dbo.F1_Data.Eval_Date LEFT OUTER JOIN
dbo.Prog_Info ON dbo.F1_Data.INDEX1 = dbo.Prog_Info.INDEX1

WHERE (dbo.F1_Data.Allowance = 'N')

GROUP BY dbo.F1_Data.Reserve_Category, dbo.F1_Data.Accounting_Name,
dbo.F1_Data.Company, dbo.F1_Data.MCO_PCO, dbo.F1_Data.ASL,

dbo.F1_Data.Year, dbo.Prog_Info.INDEX1,
dbo.Prog_Info.Retained_QS, dbo.Prog_Info.XS_Rate

Thank you
Alex Dybenko
2007-11-13 13:31:39 UTC
Permalink
Hi,
you can multiply by 100 and add % at the end, but not sure this is a good
idea to do so in a view. Better leave it as it, and when you display it in
form or report - make required formatting
--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com
Post by Les
I have created a view with in SQL Server 2005.
Is there a way to format the columns so that they are in a percentage format?
How about a comma?
Here is an example of my view. I would like to make
"dbo.Prog_Info.Retained_QS"
in comma format and "dbo.Prog_Info.XS_Rate" in percentage format.
SELECT dbo.F1_Data.Reserve_Category, dbo.F1_Data.Accounting_Name,
dbo.F1_Data.Company, dbo.F1_Data.MCO_PCO, dbo.F1_Data.ASL,
dbo.F1_Data.Year, dbo.Prog_Info.INDEX1, dbo.Prog_Info.Retained_QS,
dbo.Prog_Info.XS_Rate
FROM dbo.Current_Eval_Date INNER JOIN
dbo.F1_Data ON dbo.Current_Eval_Date.Eval_Dt =
dbo.F1_Data.Eval_Date LEFT OUTER JOIN
dbo.Prog_Info ON dbo.F1_Data.INDEX1 = dbo.Prog_Info.INDEX1
WHERE (dbo.F1_Data.Allowance = 'N')
GROUP BY dbo.F1_Data.Reserve_Category, dbo.F1_Data.Accounting_Name,
dbo.F1_Data.Company, dbo.F1_Data.MCO_PCO, dbo.F1_Data.ASL,
dbo.F1_Data.Year, dbo.Prog_Info.INDEX1,
dbo.Prog_Info.Retained_QS, dbo.Prog_Info.XS_Rate
Thank you
Loading...