Share via

Access Fixed width txt file creation

Anonymous
2022-07-14T19:39:46+00:00

I am creating a fixed width .txt file. I have a phone number of 1112223333 and when the 13 width file is created it displays the number as 1112223333.0. I also have an age field that has a width of 3 and it shows as 23. Can someone point in the right direction to remove both the .0 and . issues

Microsoft 365 and Office | Access | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Anonymous
    2022-07-14T21:01:58+00:00

    What is the datatype of the phone number in your Access table? It should be text, not any flavor of Number (you don't do calculations with phone numbers, usually!)

    Try exporting Cstr([phonenumber]) or Format([phonenumber], "0000000000") to explicitly cast the field as a String.

    Was this answer helpful?

    0 comments No comments
  2. Duane Hookom 26,825 Reputation points Volunteer Moderator
    2022-07-14T20:12:56+00:00

    I don't get the same results as you do. Perhaps it's the version of MS Access. You could try create a query with the correct formats and then export the query.

    Was this answer helpful?

    0 comments No comments