Need to format a field to a certain number of decimal places?
Just do this:
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
CAST([itemTotal] AS decimal(8,2)) AS [total]
1CAST([itemTotal] AS decimal(8,2)) AS [total]
So a full query would look like:
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
Select field1,
field2,
field3,
CAST([itemTotal] AS decimal(8,2)) AS [total],
field4
from dbo.table
1Select field1,
2field2,
3field3,
4CAST([itemTotal] AS decimal(8,2)) AS [total],
5field4
6from dbo.table
This will supply you with the field 'Total' in an 'xx.xx' format.
There are no comments for this entry.
[Add Comment] [Subscribe to Comments]