PC Review


Reply
Thread Tools Rate Thread

Exporting Fixed Width Text

 
 
Marc
Guest
Posts: n/a
 
      3rd Sep 2009
I'm curently trying to export a table to a fixed width text file. I have 2
columns that that are prices. When I try to export it truncates the number.
For example if the price is 78 dollars then it needs to be 78.00 format. Any
ideas on how I can keep it from truncating the zeros?

Also I need the price columns to be aligned right any thoughts on how to do
that as well.
 
Reply With Quote
 
 
 
 
Ken Snell [MVP]
Guest
Posts: n/a
 
      3rd Sep 2009
Create a query that is based on your table. Put all the fields from the
table on the query grid.

For each of the price fields, change the name in the Field: cell to an
expression similar to this:

PriceName1: Format(PriceField1, "0.00")

I've used generic names above; use correct names and a meaningful alias
(PriceName1) name. Different alias names needed for each field.

Then export the query instead of the table. Be sure to change your Export
specification (if you're using one) to look for the alias names instead of
the original field names.

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/



"Marc" <(E-Mail Removed)> wrote in message
news:642EA313-81FE-41C0-8D11-(E-Mail Removed)...
> I'm curently trying to export a table to a fixed width text file. I have
> 2
> columns that that are prices. When I try to export it truncates the
> number.
> For example if the price is 78 dollars then it needs to be 78.00 format.
> Any
> ideas on how I can keep it from truncating the zeros?
>
> Also I need the price columns to be aligned right any thoughts on how to
> do
> that as well.



 
Reply With Quote
 
 
 
 
Marc
Guest
Posts: n/a
 
      4th Sep 2009
That worked great! Thank you!

If I wanted the format of the price to be 00000938.25 is that possible to
have the price in that format when your exporting to a text?

"Ken Snell [MVP]" wrote:

> Create a query that is based on your table. Put all the fields from the
> table on the query grid.
>
> For each of the price fields, change the name in the Field: cell to an
> expression similar to this:
>
> PriceName1: Format(PriceField1, "0.00")
>
> I've used generic names above; use correct names and a meaningful alias
> (PriceName1) name. Different alias names needed for each field.
>
> Then export the query instead of the table. Be sure to change your Export
> specification (if you're using one) to look for the alias names instead of
> the original field names.
>
> --
>
> Ken Snell
> <MS ACCESS MVP>
> http://www.accessmvp.com/KDSnell/
>
>
>
> "Marc" <(E-Mail Removed)> wrote in message
> news:642EA313-81FE-41C0-8D11-(E-Mail Removed)...
> > I'm curently trying to export a table to a fixed width text file. I have
> > 2
> > columns that that are prices. When I try to export it truncates the
> > number.
> > For example if the price is 78 dollars then it needs to be 78.00 format.
> > Any
> > ideas on how I can keep it from truncating the zeros?
> >
> > Also I need the price columns to be aligned right any thoughts on how to
> > do
> > that as well.

>
>
>

 
Reply With Quote
 
Marc
Guest
Posts: n/a
 
      4th Sep 2009
I have figured it out. Thanks!!

"Marc" wrote:

> That worked great! Thank you!
>
> If I wanted the format of the price to be 00000938.25 is that possible to
> have the price in that format when your exporting to a text?
>
> "Ken Snell [MVP]" wrote:
>
> > Create a query that is based on your table. Put all the fields from the
> > table on the query grid.
> >
> > For each of the price fields, change the name in the Field: cell to an
> > expression similar to this:
> >
> > PriceName1: Format(PriceField1, "0.00")
> >
> > I've used generic names above; use correct names and a meaningful alias
> > (PriceName1) name. Different alias names needed for each field.
> >
> > Then export the query instead of the table. Be sure to change your Export
> > specification (if you're using one) to look for the alias names instead of
> > the original field names.
> >
> > --
> >
> > Ken Snell
> > <MS ACCESS MVP>
> > http://www.accessmvp.com/KDSnell/
> >
> >
> >
> > "Marc" <(E-Mail Removed)> wrote in message
> > news:642EA313-81FE-41C0-8D11-(E-Mail Removed)...
> > > I'm curently trying to export a table to a fixed width text file. I have
> > > 2
> > > columns that that are prices. When I try to export it truncates the
> > > number.
> > > For example if the price is 78 dollars then it needs to be 78.00 format.
> > > Any
> > > ideas on how I can keep it from truncating the zeros?
> > >
> > > Also I need the price columns to be aligned right any thoughts on how to
> > > do
> > > that as well.

> >
> >
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting data to a fixed width text file =?Utf-8?B?Sm9obg==?= Microsoft Access External Data 1 9th Feb 2005 05:33 PM
Problem encountered while exporting Fixed Width Text using a Macro Ed Hamblin Microsoft Access External Data 2 21st May 2004 12:10 PM
Exporting Delimited and Fixed Width Text Formatting Waylen Microsoft Access External Data 4 19th May 2004 04:16 AM
Exporting to fixed width text file Debbie Microsoft Access External Data 3 17th Feb 2004 09:40 PM
Fixed Width - Opening Certain Fixed Width Files Jan Microsoft Excel Programming 2 30th Dec 2003 09:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:46 AM.