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!

Format for imported text field

Status
Not open for further replies.

Clandon

MIS
Jul 22, 2003
32
US
I am importing a txt file with a field into a table that could be less than the desired 10 character length. I would like the field to import as 10 character with leading zeros if it is less than 10. I want to keep it as a text field instead of numeric.

I am able to format the field in a query using Format([field],"0000000000").

I have tried "0000000000" and @@@@@@@@@@ in the format of the table, and an input mask in the table design, but they are not working.

Any suggestion is appreciated. [surprise]



 
I tried Format([Field],"0000000000") and it worked just fine.

Are you sure that [Field] is defined as a text field?

Jim DeGeorge [wavey]
 
Hi Jim.

Are you formatting it in a query or in the table design format box on the general tab in desing view for the table?

The query works for me, but I was looking for a format to hold the import field so I wouldn't have to create an additional formatting query for linking purposes.

Any other suggestions?

Cheryl[fish2]
 
Ah. No I didn't, just the query grid. But I just tried to set a table's field to that format and it didn't work.

I do something similar with leading characters and I choose to do it right in the query. Sorry.

Jim DeGeorge [wavey]
 
Thanks for the help anyhow. If you happen to figure it out, please let me know.

Cheryl [smile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top