Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

how to use trim in access 2013 to cut extra spaces

Posted on 2014-01-12
6
1,135 Views
Last Modified: 2014-01-12
hi

i have some strange problem that when i make with a query for example:
NSERT INTO IskitTemp ( ProductName ) Select ProductName From ProductTbl

Open in new window

i get a list with  all products name with extra spaces that increase the character in the productName field to  250 characters (like the Restriction of The maximum amount of characters that can stored in the product name in the producttbl, but in the producttbl it's dosn't have so much  spaces  so why in iskittemp is so much spaces ?
0
Comment
Question by:bill201
  • 3
  • 3
6 Comments
 
LVL 50

Expert Comment

by:Rgonzo1971
ID: 39774620
HI,

whitout more info about IsKitTemp

pls try

INSERT INTO Trim(IskitTemp ( ProductName ) )Select ProductName From ProductTbl 

Open in new window

Regards
0
 

Author Comment

by:bill201
ID: 39774634
there is something wrong in your code, it's not working and i get an error message
0
 
LVL 50

Expert Comment

by:Rgonzo1971
ID: 39774644
Hi,

What is Definition of Product Name In the ProductTbl?

EDIT Are you using VARCHAR(n)  because CHAR(n) will add blanks at the end?

INSERT INTO IskitTemp ( ProductName ) Select Trim(ProductName) From ProductTbl 

Open in new window


Regards
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:bill201
ID: 39774648
i create it with sql string :

the Definition of Product Name In the ProductTbl is short text field size (255)

the iskttemp i create with a sql string like this
CREATE TABLE  (ProductName CHAR (255))

Open in new window

0
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39774652
Hi,

With CHAR it adds Blank Space to create a 255 Character Long Field, pls use VARCHAR

Regards
0
 

Author Comment

by:bill201
ID: 39774657
thanks a lot, now there is no problem
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem with vba code 4 39
SQL Syntax Grouping Sum question 7 24
RAISERROR WITH NOWAIT 2 16
Access 2016 - combo box 3 16
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question