Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using Trim Function in SQL Server SQL Statement

Posted on 2008-06-18
1
Medium Priority
?
832 Views
Last Modified: 2008-06-18
I have use the trim function as part of SQL statements when reading data from a MS Access database.   I have used this as part of search criteria in the SQL statement to make sure that any random spaces are removed so that matches are found.   I am trying to read data from a SQL Server database and the trim function does not work because it is not a built in function.  Is their any equivalent to the trim function that can be used with SQL server.   An example of what i have used with access databases is as follows:

SELECT * from tblInfo where Trim(Rec_ID) = '" & sCrit & "'"
0
Comment
Question by:Mike_Stevens
[X]
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
1 Comment
 
LVL 93

Accepted Solution

by:
Patrick Matthews earned 2000 total points
ID: 21812087
SQL Server uses LTRIM and RTRIM to remove leading/trailing spaces, respectively.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
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 …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

721 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