Align Right certain fields of a query when exporting as fixed width txt file

L

lastcall

Hi,

I have a table that has all alignment settings for every field (i.e. Left or
Right). I created a query of that table to omit certain fields in the
exporting process. When I am exporting the query as a text file-fixed width,
they are all left aligned. I need to be able to keep this right align fields
while the export is happening. Any help is appreciated!!!...:)
 
K

Ken Snell

Use calculated fields to be the right-aligned columns.

Here's an example of how to write the calculated fields:

FieldName_Calc: Right(Space(SizeOfFixedWidthColumn) & [RealFieldName],
SizeOfFixedWidthColumn)


So, if the width/size of the fixed width column were 20:

FieldName_Calc: Right(Space(20) & [RealFieldName], 20)
 
J

Jerry Whittle

Since you are using fixed width, use the String function to add leading
spaces. For example if a LastName field is a maximum of 20 characters,
something like this in a query:

TheLastName: String(20-Len([LastName])," ") & [LastName]
 

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