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)
 Real datatype - format

Author  Topic 

annac
Starting Member

8 Posts

Posted - 2004-06-03 : 09:17:30
I have a query which returns a bunch of xml. Its pretty straightforward and is just pulling data directly out of tables. However, one of the fields is of real datatype. When I run a straight select, the value returned is:
10.0
however when I select the same piece of data as part of my for xml explicit statement I get: 1.0000000e+001

Clearly the same thing but in the wrong format, I want 10.0!

Have fiddled with CAST and CONVERT without any joy.

Could someone brighten up my day?

-------------------------------------------------------------
If at first you don't succeed destroy all evidence that you tried.

nr
SQLTeam MVY

12543 Posts

Posted - 2004-06-03 : 15:21:43
Try
convert(varchar(7),convert(decimal(5,1),fld))




==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -