Solved

Update SQL to remove all characters after Certain text

Posted on 2015-02-23
2
125 Views
Last Modified: 2015-02-23
I have one field that has 6 types of test in one field.

1. HMM
2. HTC
3. TMMC North
4. TMMC South
5. TMMC TIER
6. TMMC WEST.

For all records that have TMMC * I would like the text to simply read "TMMC".

So how can I use an Update Query (SQL Statement) to convert all TMMC North,TMMC South, TMMC West, TMMC TIER to simply read "TMMC'.
0
Comment
Question by:ggodwin
2 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40626699
If you are certain that you want to convert all records containing any variation of "TMMC" to show ONLY "TMMC":

UPDATE YourTable SET YourField='TMMC' WHERE YourField LIKE 'TMMC*'

I would strongly recommend you create a backup before running code like this, of course.
0
 

Author Closing Comment

by:ggodwin
ID: 40626749
Worked like a charm. Thank you!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
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…
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…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

757 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

21 Experts available now in Live!

Get 1:1 Help Now