Leading and Trailing blanks are lost on import

D

Dominic Olivastro

I am using Office 2003 on Win XP. I find that if I import a text file from
my mainframe into access, I lose both leading and trailing blanks on text
fields.

I suppose losing trailing blanks can be called a feature, but how do I get
back my leading blanks? Has anyone else noticed this?

Dom
 
J

John Vinson

I am using Office 2003 on Win XP. I find that if I import a text file from
my mainframe into access, I lose both leading and trailing blanks on text
fields.

I suppose losing trailing blanks can be called a feature, but how do I get
back my leading blanks? Has anyone else noticed this?

Dom

I have to agree with Joseph that a table containing values "Fred",
" Fred" and " Fred" and treating them as distinct is going to be more
than a bit awkward for the user! Leading and trailing blanks are
essentially data *presentation* features, and as such should (IMHO)
typically not be stored in the table.

It's obscure, but you *can* create a fixed-text field in an Access
table, using the DDL "Create Table" query. By default, text fields are
a type of varchar and truncate both trailing and leading blanks; a
fixed text field will retain them (causing the database to grow faster
since all the Text fields are occupied to their full length).

John W. Vinson[MVP]
 
D

Dominic Olivastro

That's not a feature, it's a bug. First, leading blanks are not trimmed if
I enter the data by hand or through ADO. Second, larger databases, like
Sybase and Oracle and even MS's own SQL_Server, do not routinely trim
leading blanks. Third, if I want them trimmed, I can always do an update
query.

As to why I need leading spaces, the data is a number with an implied
decimal point after the third character. So that "bb250" (or 2.50) is not
the same as "250" (or 250)

Dom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top