Hi,
I would like to know if there is any trick to convert numbers to csv files. I don't have any control to format the numbers.
Source: Sql server
for example:
select cast( 1 as float)/ cast(201 as float)
Destination:CSV file
the output of the file is 4,9751243E-3
i don't want to have scientific notation on the number. I want the result to be 0,00497512437810945. how can i do it?
I tried to change the type of destination columns to String or numeric but nothing works. what is the influence of changing data type in the destination columns e the output to files?
I tried using convert but with the same results.
Can it be because of local settings or something else?
thanks
prb222
I am having this SAME problem and would be very happy if someone could provide a solution. I have found the only way to keep a long string of numbers in text format, is to switch it to text and then click on each individual cell and then the formula bar. This will not work when there are thousands of rows of records - way too much manual work. There has to be some way for the numbers to stay in their original format. HELP!!|||Hi,
If I use a data viewer, I see the normal value but in the csv it gets converted to scientific.
I found this workaround. In case you do not need more precision, you should be fine.
select cast(cast( 1 as float)/ cast(201 as float) as decimal(28,28)) as myOutput
It generates the csv like this
.0049751243781094500000000000
if I open it in Excel I get this
0.00497512437810945
Philippe
|||I was having the same problem. I asked my co-worker if he knew, and said they put four quotes then concatenate in the select statement like '''' + field_name.
No comments:
Post a Comment