Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
chipembele
Posting Yak Master
106 Posts |
Posted - 2007-01-16 : 10:01:44
|
HiCan anyone tell me how I can CAST these fields AS DECIMAL (19, 2) please? (SELECT ([Total students] - [withdrawn] - [transferred] - [cancelled]) / [total Students] * 100 AS [Percentage Retained])ThanksDaniel |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-16 : 10:11:02
|
SELECT CAST(([Total students] - [withdrawn] - [transferred] - [cancelled]) / [total Students] * 100 AS DECIMAL(19, 2)) AS [Percentage Retained]Was not Books Online clear enough for this?Peter LarssonHelsingborg, Sweden |
|
|
chipembele
Posting Yak Master
106 Posts |
Posted - 2007-01-16 : 10:21:50
|
quote: Originally posted by Peso SELECT CAST(([Total students] - [withdrawn] - [transferred] - [cancelled]) / [total Students] * 100 AS DECIMAL(19, 2)) AS [Percentage Retained]Was not Books Online clear enough for this?Peter LarssonHelsingborg, Sweden
Thankyou Peter.I did a google search on CAST but it wasn't very helpful. Books online? |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-16 : 10:27:58
|
Yes, the very comprehensive help file installed with SQL Server and/or Query Analyzer.Peter LarssonHelsingborg, Sweden |
|
|
chipembele
Posting Yak Master
106 Posts |
Posted - 2007-01-16 : 10:29:57
|
quote: Originally posted by Peso Yes, the very comprehensive help file installed with SQL Server and/or Query Analyzer.Peter LarssonHelsingborg, Sweden
I will bear that in mind. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-16 : 10:33:04
|
For easy access to the Books Online, just highlight the keyword CAST in Query Analyzer and press SHIFT-F1.Peter LarssonHelsingborg, Sweden |
|
|
chipembele
Posting Yak Master
106 Posts |
Posted - 2007-01-16 : 11:08:44
|
THanks |
|
|
|
|
|