Removing Parts of a field

rschultz

Registered User.
Local time
Today, 23:17
Joined
Apr 25, 2001
Messages
96
I have data in a field that looks like this: E-221 RATE OR E-32 RATE. I need to get rid of all the text. I tried variations of this: UPDATE [APS Import Test] SET [APS Import Test].[Rate Code] = Right([Rate Code],5)=""
WHERE ((([APS Import Test].[Rate Code]) Like "*RATE*")); but I keep getting just 0s. Any ideas how to get rid of the word RATE and the E-?
 
okay I did it, but I needed the two SQL statements listed here. Is there a way to link these so there is just one statement?

First I did this:
UPDATE [APS Import Test] SET [APS Import Test].[Rate Code ] = IIf(Left([Rate Code],2)="E-",Mid([Rate Code],3),[Rate Code]);

Then I did this:
UPDATE [APS Import Test] SET [APS Import Test].[Rate Code ] = IIf(Left([Rate Code],3)="",Left([Rate Code],2),Left([Rate Code],3));
 

Users who are viewing this thread

Back
Top Bottom