Export to .csv Losing leading zeros

nigelh

Registered User.
Local time
Today, 14:06
Joined
Sep 27, 2001
Messages
27
Hi,

I'm exporting a table to a .csv file. The table contains phone numbers with a data type of 'text'. When I look at the csv file strange things are happening
e.g Phone number 08705329877 appears as 8.7E+09 if I expand the width of the field in the csv it changes to 8705329877 (miising the leading zero).

Can anyone help?

Cheers,

Nigel
 
In your db, you must have phone numbers defined as numeric with a format that ensures leading zeros. To export numeric fields as fixed length with leading zeros, you need to use a query so that you can use the Format() function.

Select Format(TeleNum,"00000000000") As FormattedTel, ....

Then export the query rather than the table.
 
Dufuss in da house

Sorry Chaps,
Please explain how to do this to an imbasile,
I have the table and now ran simple query wizard, got all the required fields, please where and how do I enter "Select format.........." thingy.
Need to have done this by the morning uk time -in deep trouble

Fanks

Brutal
 
Open the query in QBE view.
Change the tele field to:

FormattedTel:Format(TeleNum,"00000000000")

Obviously, you'll need to change the column name to your own. The structure of this is:

TheOutputFieldName:Format(YourPhoneField,"0000000000")

Change the red parts. Use as many zeros as you need to get the correct field length.
 
Ta Very Much

Thankyou
I cannot thank the people on this forum enough for all the help thay give me - I am such a dunce, You all get me out of so many scrapes, especially you Pat.

Thanks Again

Brutal
 

Users who are viewing this thread

Back
Top Bottom