Connecting Tech Pros Worldwide Help | Site Map

acExportDelim With Leading Zeros

Clint Stowers
Guest
 
Posts: n/a
#1: Nov 12 '05
Using A2k

Exporting a query to a CSV file. The problem is any text fields (i.e. 000345)
lose any leading zeros.

Exporting to an excel file this problem does not exist.

Tried to create a SpecificationName via the Export Wizard without success.
Obviously doing something wrong.

Any suggestions appreciated. Thanks in advance.




"And.... Exactly at which point did you consider this a good idea?"
Trevor Best
Guest
 
Posts: n/a
#2: Nov 12 '05

re: acExportDelim With Leading Zeros


On 16 Jan 2004 02:28:11 GMT in comp.databases.ms-access,
clint2001@aol.comNoSpam (Clint Stowers) wrote:
[color=blue]
>Using A2k
>
>Exporting a query to a CSV file. The problem is any text fields (i.e. 000345)
>lose any leading zeros.
>
>Exporting to an excel file this problem does not exist.
>
>Tried to create a SpecificationName via the Export Wizard without success.
>Obviously doing something wrong.
>
>Any suggestions appreciated. Thanks in advance.[/color]

You need to create a query, the formatted field should be in the grid
as something like:

Aliasname: Format(FieldName,"000000")

Then export the query.

--
A)bort, R)etry, I)nfluence with large hammer.
Clint Stowers
Guest
 
Posts: n/a
#3: Nov 12 '05

re: acExportDelim With Leading Zeros



Have taken the query that has a field "SalesOrder" (sample:000123) and in the
same query created field "NewSalesOrder: Format([SalesOrder],"000000").

When I export this query using acExportDelim fields fail to maintain the
leading zeros.

Any thoughts?





"And.... Exactly at which point did you consider this a good idea?"
Trevor Best
Guest
 
Posts: n/a
#4: Nov 12 '05

re: acExportDelim With Leading Zeros


On 16 Jan 2004 15:48:12 GMT in comp.databases.ms-access,
clint2001@aol.comNoSpam (Clint Stowers) wrote:
[color=blue]
>
>Have taken the query that has a field "SalesOrder" (sample:000123) and in the
>same query created field "NewSalesOrder: Format([SalesOrder],"000000").
>
>When I export this query using acExportDelim fields fail to maintain the
>leading zeros.
>
>Any thoughts?[/color]

Do you have an export specification in place that is still treating
this column as numeric?

--
A)bort, R)etry, I)nfluence with large hammer.
Clint Stowers
Guest
 
Posts: n/a
#5: Nov 12 '05

re: acExportDelim With Leading Zeros


In article <g0hg00lls8v0ue5680qbloj786ojcioc74@4ax.com>, Trevor Best
<bouncer@localhost> writes:
[color=blue]
>Do you have an export specification in place that is still treating
>this column as numeric?[/color]

I removed the SpecificationName just in case. Leading zeros in both the
orignal field and the formated field were removed.

However I found this to be the case when exporting to "MyFile.csv". When
exported to "MyFile.txt", both field maintain the leading zeros.

Currently checking to see if the software being export to will axcept an "txt"
extention. The text file should survice in that the data contains no true
numeric data. Just account and zipcodes. So I this point there may be no need
to reinvent the wheel.

Althought it would be nice to know why I can't place the leading zeros in the
"cvs" file.





"And.... Exactly at which point did you consider this a good idea?"
Trevor Best
Guest
 
Posts: n/a
#6: Nov 12 '05

re: acExportDelim With Leading Zeros


On 16 Jan 2004 21:46:43 GMT in comp.databases.ms-access,
clint2001@aol.comNoSpam (Clint Stowers) wrote:
[color=blue]
>In article <g0hg00lls8v0ue5680qbloj786ojcioc74@4ax.com>, Trevor Best
><bouncer@localhost> writes:
>[color=green]
>>Do you have an export specification in place that is still treating
>>this column as numeric?[/color]
>
> I removed the SpecificationName just in case. Leading zeros in both the
>orignal field and the formated field were removed.
>
>However I found this to be the case when exporting to "MyFile.csv". When
>exported to "MyFile.txt", both field maintain the leading zeros.
>
>Currently checking to see if the software being export to will axcept an "txt"
>extention. The text file should survice in that the data contains no true
>numeric data. Just account and zipcodes. So I this point there may be no need
>to reinvent the wheel.
>
>Althought it would be nice to know why I can't place the leading zeros in the
>"cvs" file.[/color]

I don't know if it has anything to do with Excel being the registered
application for opening .csv files but it has to be said, Excel is a
pile of poo when it comes to handling data. Only the other day I was
exporting data to Excel, which consisted mostly of dates. Being in the
UK all my settings are UK, including dates (dd/mm/yyyy) even so, Excel
would only treat the dates that were valid in US format (e.g.
03/04/2004) as dates and right aligned, all others (e.g. 13/01/2004)
were treated as text and left aligned.

--
A)bort, R)etry, I)nfluence with large hammer.
Clint Stowers
Guest
 
Posts: n/a
#7: Nov 12 '05

re: acExportDelim With Leading Zeros


In article <smug009il6ptohpsfvmqk7eehhp25gumie@4ax.com>, Trevor Best
<bouncer@localhost> writes:
[color=blue]
>I don't know if it has anything to do with Excel being the registered
>application for opening .csv files but it has to be said, Excel is a
>pile of poo when it comes to handling data.[/color]

What is being created is just an intermidiate file to be wused between two
external software applications. I don't believe Excel is at issue at the
moment. I origionally exported the data to an excel file without ill affect,
then asked to make it a cvs file.

But due to what has previously been mentioned a "txt" file should survice. And
due to skill level may have to survice. At least for the moment.





"And.... Exactly at which point did you consider this a good idea?"
Closed Thread