Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Float to 2 decimal positions

Status
Not open for further replies.
Mar 9, 2006
93
CA
I have a column named 'Amount' that is of type float. I would like to in a select statement display this column with only 2 decimal positions. Does anyone know how to do this? I thank you in advance for your help.
Matt
 
Try this...

Code:
CAST(AmountField AS DECIMAL(10,2)) AS AMOUNT
 or
CAST(AmountField AS NUMERIC(10,2)) AS AMOUNT

I think that should do what you're looking for. Just change the (10,2) to whatever precision you need.

Cheers!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top