Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing into EXCEL a string field that has a leading zero

Status
Not open for further replies.

buttersoft

Programmer
Jun 11, 2000
75
CH
We have a field with telephone numbers and designated as VARCHAR2(40). When we run queries the data has the leading zero of the telephone number.

However, when importing into EXCEL the leading zero is dropped, UNLESS you specifically tell EXCEL that that field is to be parsed as TEXT.

Is there not a way to fix this in Oracle, so that we can import files automatically i.e. with macros/scripts and NOT drop the leading zero. Steve Butterworth
 
Isn't this an annoying feature of Excel!!

I think that if you concatonate a single speach mark on to the front of a number when excel imports that number it will convert it into a string (works that way through the normal front end anyway, try it)

so for example the following should do it

select ''''||'012345' from dual;

would give you '012345

when you import this into excel it should just read 012345

HTH,

Mike.
 
Thanks very much for that it does work. How many times have we looked ofr that needle in a haystack Steve Butterworth
 
'' || dansnextensiondetail.extension

This works perfectly.

Thank you for the help Steve Butterworth
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top