Friday, March 9, 2012

Decimals in SQL Server

I need to display decimal results from SQL Server queries, but the decimals keep getting truncated. For example, 9 divided by 4, keeps getting truncated to 2. Does anyone know how to display the whole result, including the decimals?You will need to cast the integers to something that supports decimals.
SELECT 9 / CAST( 4 as float )
--results
2.25
bill|||Thanks. That did it.

No comments:

Post a Comment