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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 how to format the numeric values

Author  Topic 

thiyait
Yak Posting Veteran

70 Posts

Posted - 2005-01-13 : 09:09:30

Hi All:


This is my query:
select 4567.0000

I need the result like this:4567.00

Is there any format function in sqlserver to achieve the result?

thanks
thiya

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2005-01-13 : 09:13:55
It's really a format issue and should be handled by the front end application. Having said that, here you go:

DECLARE @number DECIMAL(8,4)

SELECT @number = 4567.0000

SELECT CAST(@number AS DECIMAL(6,2))

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page
   

- Advertisement -