Right Trim

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table that I would like to remove everything to the right of the 1st
3 letters in a field.

IE: LAX Los Angeles, CA or SFO San Francisco, CA

All I want to keep in this field is the Airport Code Designation which in
this example would leave LAX in the 1st record and SFO in the second record.

Can I do this in an update qurey? Please provde assistance with syntax.

Thanks in advance for any assistance you may be able to provide.
 
Left([WhateverTheFieldIsCalled], 3)

If you want to do this permanently, you'd use an Update query. If you only
need to be able to display it, you can simply use that in a query as a
calculated field.
 
Yes, you can do it though an update query. Start a new query in design view,
select the table and get the field down to the grid; I'll assume the field
to be called fldAirport for the purpose of this example, and you'll change
accordingly.
Go to menu item Query > Update; notice the new line headed Update to that
appears in the grid; in this line, under the field fldAirport, type in:
Left([fldAirport],3)
(remember to use the actual field name). Run the query through the menu
(Query > Run), confirm that you want the changes made to the records, and
you're done.

As a general rule, whenever you're trying something new, or of which you are
not 100% sure, make a back-up copy of your .mdb before you try it!

HTH,
Nikos
 
Back
Top