• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 271
  • Last Modified:

NEED TO TRIM AN ENTIRE TABLE.

Hi there I have serveral tables that come from a SQL server.  When the tables are linked to Access most of the fields have spaces before and after the data.  In each table there is just too many fields to use the trim([field name]) on all of them.  Is there a function that can update all the fields at once?  Also is there a way that when the SQL tables are import or linked that the fields are automatically trimmed without having to do this if the trim all fields is not available.  Thank you so much.
0
CLSTEAM
Asked:
CLSTEAM
  • 2
  • 2
1 Solution
 
jerryb30Commented:
If you have imported the tables into Access, it would be fairly simple to write a function to trim existing data in existing fierlds in all tables.  Do not know if this is do-able (or wise) for data in tables in the SQL Server db.  


0
 
LucasMS Dynamics DeveloperCommented:
If you want to remove the spaces, you have to change the data type on the SQL server side.  I'm not sure what it is, but it might by nVarChar or VarChar.  

I have the same problem, but it shouldn't matter when you generate queries otherwise you'll have to use the TRIM function in your query.
0
 
CLSTEAMAuthor Commented:
Ok I understand but is there a function that does a Trim([Table*])  

If I do this then I get a message that you cannot update using *

I think that it is a great tool but having to do each one, one by one by one!

0
 
jerryb30Commented:
CLSTEAM:
There is not an existing function within Access for this.  It is doable, if you have imported the tables, creating your own function.  It may seem slow, depending on how many tables, fields, records.
0
 
CLSTEAMAuthor Commented:
Ok - just wanted to see if I was missing something.  Thanks so much.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now