Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update records query 1

Status
Not open for further replies.

TheRiver

IS-IT--Management
Dec 18, 2003
121
0
0
GB
I have a table, within which I want to update a field.

Currently it has 5 characters within the field, eg:

5TR65
RTE32

I want to delete the 4th and 5th charcters for all recordss in the field.

How can i do this?

 
Hi

Make an update query:

UPDATE MyTable Set MyCol = Left(MyCol,3) & Mid(MyCol,6)

You need to use your table and column names of course in place of My..

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Thats great it works fine.

Just so I know what you did, Left,3 picks up the first three characters and Mid,6 picks up anything over 6 characters, so characters 4 and 5 are missed out.

Is that correct?
 
Hi

You got it

Could have also used the Right() function instead of Mid()

Mid() is useful if you want to say effectively from point x to the end without knowing how long it is to the end



Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top