Exporting to ASC

P

phuser

I have a table that is being exported to an Fixed width ASC file but I am
unable to keep the right alignments, the table looks corrrect and I have
added an ! to the input mask. What am I missing??? Any help would be
greatly appreciated.
 
K

Ken Snell \(MVP\)

Pad the value with spaces in the query that you export:

SELECT Right(Space(100) & [YourField], 100) As TheField
FROM YourTable;

I've used 100 as the width of the fixed width field size, so change it to
whatever the width of the field should be in the text file.
 
P

phuser

Thank you so much Ken, that worked perfect for all fields except for
currency, for some reason when it gets exported it looses it's currency
format and doesnt align to the right either.


Ken Snell (MVP) said:
Pad the value with spaces in the query that you export:

SELECT Right(Space(100) & [YourField], 100) As TheField
FROM YourTable;

I've used 100 as the width of the fixed width field size, so change it to
whatever the width of the field should be in the text file.
--

Ken Snell
<MS ACCESS MVP>



phuser said:
I have a table that is being exported to an Fixed width ASC file but I am
unable to keep the right alignments, the table looks corrrect and I have
added an ! to the input mask. What am I missing??? Any help would be
greatly appreciated.
 
K

Ken Snell \(MVP\)

Currency format will leave a space at far right where a ) character would go
when the number is negative. Is that what you're seeing?

If you want the value to have the $ sign and be right-justified, then it'll
take a few extra items to make this happen. Try this (using same generic
setup as in my first suggestion):

SELECT Right(Space(100) & "$" &
Format(YourCurrencyFieldName, "0.00"), 100)
AS TheCurrencyField
FROM YourTable;

--

Ken Snell
<MS ACCESS MVP>




phuser said:
Thank you so much Ken, that worked perfect for all fields except for
currency, for some reason when it gets exported it looses it's currency
format and doesnt align to the right either.


Ken Snell (MVP) said:
Pad the value with spaces in the query that you export:

SELECT Right(Space(100) & [YourField], 100) As TheField
FROM YourTable;

I've used 100 as the width of the fixed width field size, so change it to
whatever the width of the field should be in the text file.
--

Ken Snell
<MS ACCESS MVP>



phuser said:
I have a table that is being exported to an Fixed width ASC file but I am
unable to keep the right alignments, the table looks corrrect and I have
added an ! to the input mask. What am I missing??? Any help would be
greatly appreciated.
 
Top