Exporting to a text file.

  • Thread starter Morgan Gartland via AccessMonster.com
  • Start date
M

Morgan Gartland via AccessMonster.com

Hi all,
I am having a problem with getting an exported file to look the way i want
it to.

The problem is that the numbers are showing two decimal places (4.00
instead of 4). i have tryed changing the export spec but this seems to
make no difference, i have also changed the relivant field in the query eg
fixed with no decimal places.

The export code is as follows:
DoCmd.TransferText acExportDelim, "Export_ga Export Specification",
"qry_Export_ga", ExportPatha, True

the export spec is as follows:
Delimited - Field Delimiter= ,
Text qualifier = none
Language = English
Code Page = Western European (Windows)

If anyone could point me in the right direction i would be most greatful

Cheers
Morgan
 
G

George Nicholson

Consider converting your number to a string of your liking in the query:

MyNewNumber: = Format([MyOldNumber],"#####0")

No guarantees. Depends on what is reading the text file.

HTH,
 
M

Morgan Gartland via AccessMonster.com

Hi George

Thanks for your help, i have given you advice a go but unfortunately it has
made no difference.

I have also relised that i left out the fact the the field is calculated
(sorry).

Thanks
Morgan
 
M

Morgan Gartland via AccessMonster.com

Hello again.
I have got a resolution for my problem.

I have created a new import spec that is exactly the same as the other one
i was using and now i no longer get decimal places on my numbers.

Thanks for your help
Morgan ????????
 
M

Michael J. Strickland

In table design view for the table you are exporting, set the "Decimal
Places" property for the fields you want exported as integers to 0. The
default for "Number" data types is 2 decimal places which causes the numbers
to export with 2 decimal places.
 
T

Tim Ferguson

The problem is that the numbers are showing two decimal places (4.00
instead of 4). i have tryed changing the export spec but this seems
to make no difference, i have also changed the relivant field in the
query eg fixed with no decimal places.

Use a query, and do whatever you want to the number explicitly:

SELECT This, That, TheOther,
FORMAT(INT(MyNumber),"0000") AS MyFormattedNumber
FROM Somewhere
WHERE etc, etc

HTH


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top