Formatting numeric data as text

Mariners

New member
Local time
Today, 11:31
Joined
Mar 14, 2007
Messages
6
Access 97 SR1

I am importing a file that has two numeric fields in it. I was asked to import as fixed length text fields with leading zeroes and no decimal point.

I am supposed to export the data in Csv format.

Source field from IBM iSeries DB: quantity is 15,3. Quantity source value is 9, requested text format of five characters 00009, the Csv result is 9. The field in Access is defined as Text 5 characters.

Source field from IBM iSeries DB: price is 17,4. Price source value is 1020.0000, requested text format of nine characters 000001020, the Csv result is 1200.00. The field in Access is defined as Text 9 characters.


Thanks,

Dave
 
The file is in CSV format. The only way to import the data that way is if each field is in TEXT format. If the fields are numeric, leading zeros will go away.

Now, here's the tricky part. Do you really give a rat's patootie what the data looks like while it is dormant inside the database? 'cause if not, the solution to your problem is to display the data via a query that has appropriate format statements in it. You can look at the FORMAT function in the Access Help files. What good does this do you? Well, maybe none. But a query is equally valid as a recordsource. You can do what you need with that query just as though it were a table (most of the time.)
 

Users who are viewing this thread

Back
Top Bottom