Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Access SQL get rid of spaces

Posted on 2011-05-10
5
Medium Priority
?
356 Views
Last Modified: 2012-05-11
Hi
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'"
0
Comment
Question by:Murray Brown
5 Comments
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 1000 total points
ID: 35727572

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

Expert Comment

by:Lee Savidge
ID: 35727581
Use Trim()


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

http://www.databasedev.co.uk/access-sql-string-functions.html
0
 
LVL 77

Assisted Solution

by:peter57r
peter57r earned 1000 total points
ID: 35727603
"SELECT DISTINCT [Applicable to] FROM [Table1] Where trim([School]) = 'Saints'"
0
 
LVL 21

Expert Comment

by:Alpesh Patel
ID: 35727615
Using trim function.
0
 

Author Closing Comment

by:Murray Brown
ID: 35727624
Thank you both
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

569 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