November 18, 2008 at 2:23 pm
I have to columns that performs sums. However I want the specific data type to be decimal with two decimal places, and not numeric. I've tried to use Convert (decimal (9,2), etc..., but I have to get it to work. I know it's something simple that I'm overlooking. Help please.
Current Code:
SELECT [Workstation Count], 100.00 * ([Total Installed] / [Total Events]) AS Installed, 100.00 * ([Total Missing] / [Total Events]) AS Missing
FROM dbo.CR_Cook_Wksta_Cnt
November 18, 2008 at 2:42 pm
rjshupert (11/18/2008)
I have to columns that performs sums. However I want the specific data type to be decimal with two decimal places, and not numeric. I've tried to use Convert (decimal (9,2), etc..., but I have to get it to work. I know it's something simple that I'm overlooking. Help please.Current Code:
SELECT [Workstation Count], 100.00 * ([Total Installed] / [Total Events]) AS Installed, 100.00 * ([Total Missing] / [Total Events]) AS Missing
FROM dbo.CR_Cook_Wksta_Cnt
Try:
SELECT [Workstation Count], 100.00 * (1.0*[Total Installed] / [Total Events]) AS Installed, 100.00 * (1.0*[Total Missing] / [Total Events]) AS Missing
FROM dbo.CR_Cook_Wksta_Cnt[/quote]
* Noel
November 18, 2008 at 2:55 pm
Good solution NoelD.
November 19, 2008 at 6:43 am
Thanks,
That still didn't work, it still is numeric.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply