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

Exporting tables with fields in correct format

Status
Not open for further replies.

ianbrown76

Technical User
Sep 13, 2002
22
GB
Hi,

I received a text file which had an income field in an incorrect format [left justified and missing some zeroes].

I imported the file to a table, made the relevant changes so it is now right justified and has leading zeroes.

How do I export the table so it is in the correct format? At the moment my income field on the exported file is left justified missing the leading zeroes.

I have tried copying the income field into a field with a data type of text but this does the same.

If anyone can help I'd most appreciate it.

Ian
 
Hi,
Create a query that you can use to export the data. But, on the fields that have the incorrect format, you can create a new field using data from the old field, plus the format function to return the desired format. Here is how it might look (presuming the name of the field in the table is called fldIncome):
IncomeFormatted: Format(([fldIncome]),"000,000,000.00")

Note, the "0" acts as a placeholder, and will display zero even if there is no value. You would use a # (pound) sign if you wish to display nothing. Of course, you can remove the ".00" if you don't want any pennies showing. HTH, [pc2]
Randy Smith
California Teachers Association
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top