Access SQL get rid of spaces

Posted on 2011-05-10
Last Modified: 2012-05-11
I am using the following Access SQL statement to find distinct values.
How do I update the statement so that it shaves any spaces off the side of the word.
For example one of the text values came up as " Parents"

"SELECT DISTINCT [Applicable to] FROM [Table1] Where [School] = 'Saints'"
Question by:murbro
    LVL 39

    Accepted Solution


    Update  [Table1]
    set [Applicable to] = Trim([Applicable to])
    LVL 25

    Expert Comment

    by:Lee Savidge
    Use Trim()

    "SELECT DISTINCT [Applicable to] FROM [Table1] Where [School] = trim('Saints')"
    LVL 77

    Assisted Solution

    "SELECT DISTINCT [Applicable to] FROM [Table1] Where trim([School]) = 'Saints'"
    LVL 21

    Expert Comment

    by:Alpesh Patel
    Using trim function.

    Author Closing Comment

    Thank you both

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
    A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
    Familiarize people with the process of utilizing SQL Server stored procedures 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 Micr…
    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…

    745 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

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now