Solved

how to use trim in access 2013 to cut extra spaces

Posted on 2014-01-12
6
1,146 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
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

685 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