Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / October 2004

Tip: Looking for answers? Try searching our database.

Right Trim

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cvegas - 07 Oct 2004 14:33 GMT
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.
Douglas J. Steele - 07 Oct 2004 14:40 GMT
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.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)

> I have a table that I would like to remove everything to the right of the 1st
> 3 letters in a field.
[quoted text clipped - 7 lines]
>
> Thanks in advance for any assistance you may be able to provide.
Nikos Yannacopoulos - 07 Oct 2004 14:41 GMT
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

> I have a table that I would like to remove everything to the right of the 1st
> 3 letters in a field.
[quoted text clipped - 7 lines]
>
> Thanks in advance for any assistance you may be able to provide.
cvegas - 07 Oct 2004 15:05 GMT
Thanks for the help.  Works great

> I have a table that I would like to remove everything to the right of the 1st
> 3 letters in a field.
[quoted text clipped - 7 lines]
>
> Thanks in advance for any assistance you may be able to provide.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.