>>>>Hi All:
>>>>
>>>>I have a table with a character field. I COPY it to an XLS. In the case that the data in the field is numeric, I want the data to be numeric in the XLS file. Right now it comews across as text since it came from a character field. The field must be character, since it sometimes contains data that is not numeric.
>>>>
>>>>Any ideas?
>>>>
>>>>Thanks,
>>>>
>>>>Yossi
>>>
>>>I'm not sure you can have different formats in the same column. It may be either numeric or character, AFAIK.
>
>Actually, that is not a problem, since for a given COPY, they will all be numeric, so I envisage something like:
>
>
>COPY fields Numericify(CharField1) TO ("c:\junk\junk") xls
>
>
>CharField1is a character field
If that's the case, simply do
copy fields myField2, cast(myFieldChar as N(10,2)) to ...
If this would not work, create a cursor first using SELECT-SQL command.
If it's not broken, fix it until it is.
My Blog