Solved

ExportText number justification

Posted on 2004-04-13
10
276 Views
Last Modified: 2012-05-04
I am exporting a data file where it seems no matter what I do, the justification is to the left.  the number is a double/fixed/2 decimal in table.  What is the deal?

Thanks

Tony
0
Comment
Question by:amangia
  • 5
  • 4
10 Comments
 
LVL 54

Expert Comment

by:nico5038
ID: 10816091
All numbers will be left justified as the lading zero's will be suppressed.
Did you try to append spaces to the left to get a fixed width like:

select right("          " & [numberfield],10) as FixedNumberField, ...

Nic;o)
0
 
LVL 77

Expert Comment

by:peter57r
ID: 10816095
Hello amangia,

What format are you exporting to?


Pete
0
 

Author Comment

by:amangia
ID: 10816248
I am exporting to a text file.
0
 
LVL 54

Expert Comment

by:nico5038
ID: 10816389
Did you try to export into a fixed format ?

Nic;o)
0
 

Author Comment

by:amangia
ID: 10816408
I am exporting to a fixed format and am using an export spec.
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 54

Expert Comment

by:nico5038
ID: 10816422
Hmm, strange as it looks like the number field is seen as text....
Did you try my uggly workaround ?

Nic;o)
0
 

Author Comment

by:amangia
ID: 10816506
To be honest, I don't know WHERE to put the workaround.  I am exporting out of a table.  I have a form with a button.  The Event Procedure behind it is:
DoCmd.TransferText acExportFixed, "FoodBuy Export Specification", "foodbuy1", "c:\RBF01" & " " & Format(Now(), "mm - yy") & ".txt", False.

Where abouts would I put the ugly little booger?
0
 
LVL 54

Accepted Solution

by:
nico5038 earned 500 total points
ID: 10816571
The "foodbuy1" will be present under the queries in the database window.
Open the query in design mode and select the field.
Now change the field in the cell like:
FixedNumberField:right("          " & [numberfield],10)

(The 10 spaces between the quotes are arbitrary and can be "expanded" to have the number of characters you need the field to be displayed) Just make sure "numberfield" is changed into the name of the field that needs justification.

Nic;o)
0
 

Author Comment

by:amangia
ID: 10816685
I did that, but still to no avail.  So...I got to thinking and changed the field type to TEXT.  Bingo!  Works now.  

Thanks Nic
0
 
LVL 54

Expert Comment

by:nico5038
ID: 10816791
Glad it works, success with the application !

Nic;o)
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now