Michael Michael - 1 year ago 75
SQL Question

Update all records to remove first 3 letters of string SQL MS Access 2013?

There is a set of data that I pulled from a server and in one of the fields, every value has the first 3 letters "DFT" with 2 or 3 letters following that. I want to use an SQL statement along the lines of:

UPDATE table_name
SET column1=[string after first 3 letters]
WHERE [first 3 letters of string]='DFT';

How would I go about doing this?

Answer Source
UPDATE table_name
SET column1 = MID(column1, 4, LEN(column1) - 3)
WHERE MID(column1, 1, 3) = 'DFT'
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download