This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JDBC and the fly likes SQL Server - convert large number to string problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "SQL Server - convert large number to string problem" Watch "SQL Server - convert large number to string problem" New topic
Author

SQL Server - convert large number to string problem

Ronan Dowd
Ranch Hand

Joined: Jan 21, 2006
Posts: 84
Hi All,

Am using oracle sqlserver express 2005. One of my table columns contains the numeric value 1878388.
When i try convert this value to a string (in my SQL statement) using the below function i get the result of "1.87839e+006"

CONVERT(VARCHAR(30), ROUND(TSGCustomer.income/1024,3) )

"1.87839e+006" is the scientific notation, I would it to return the non scientific value of 1878388, but as a string/varchar

Any help/advice would be great.
Thanks, Ronan.


SCJP 1.4 | OCWCD JEE 5
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3652

If this is a JDBC application, you can return it as a number and read it using getLong(). Otherwise, have you tried the to_char() function?


My Blog: Down Home Country Coding with Scott Selikoff
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: SQL Server - convert large number to string problem
 
Similar Threads
how to convert?
java date format stored as varchar - need to convert it into date
Couldn't Load Database Driver
Problem with TIMESTAMP(6) WITH LOCAL TIME ZONE
format a scientific notation double to a non scientific notation double