text field query

  • Thread starter Thread starter John Reynolds
  • Start date Start date
J

John Reynolds

I receive data in a text field format. Once I import this
the problem I am finding is that some of the data in not
aligned to the left. Is there any way I can set up a
query to force the data to the left?
 
John Reynolds said:
I receive data in a text field format. Once I import this
the problem I am finding is that some of the data in not
aligned to the left. Is there any way I can set up a
query to force the data to the left?

Either the import wizard is examining the data and deciding to create a numeric field
to store it in or you are importing some leading blanks. For the former, just change
the field type to text. For the latter you could run an update query setting the
field equal to itself wrapped in the Trim() function which removes leading and
trailing spaces.
 
John

Are you indicating that there are spaces in the text field that is causing
the misalignment?
If so, then you can use the function TRIM(). This will eliminate the Leading
and Trailing spaces.
There is also RTRIM() and LTRIM() to use for Right and Left,
respectivefully.

HTH

--

Rob

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Need to launch your application in the appropriate version of Access?
http://www.fmsinc.com/Products/startup/index.asp

Need software tools for Access, VB, SQL or .NET?
http://www.fmsinc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
John Reynolds said:
How exactly would I use the LTRIM() function? I am a
Access novice.

UPDATE YourTableName
SET YourFieldName = LTrim([YourTableName]![YourFieldName])

Paste the above (adjusting the names) into the SQL view of a query and then switch to
design view to see how it is set up. When you run it, all of the blanks should be
removed.
 
Back
Top