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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export query data to text file...need to eliminate decimals! 1

Status
Not open for further replies.
Jul 19, 2004
4
US
I'm hoping someone out here has done this successfully...

I need to export data from a query into a text file. The file only needs to contain three fields:

AcctNumber
Amount
Notes

Now here's the tricky part...I need to remove the decimal point from the Amount and the quotation marks from around the account number.
For example:
34.55 should be exported as 3455

AcctNumber appears "99999" in the txt file when it should be, 99999.

Is there a function I can use to eliminate the decimal? Or is there some kind of way to use the Format field? I couldn't imagine Access not being able to do this...but then again...

Please help,
codemonkey in Cincinnasty
 
Set up an Export Spec with the parameter "Text Delimiter = Nothing." For the numbers, you can multiply by 100 and use the Format(NumField,"0") function to drop any further decimal part.

Export the query manually first and press the "Advanced" button to set your options. Save the setup and use that in your macro or VBA logic.
 
Thanks for the tip! Saved me some hours of painful searching and testing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top