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 / Queries / November 2007

Tip: Looking for answers? Try searching our database.

Delete part of text from field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
prodeji - 06 Nov 2007 14:44 GMT
Hi all

Here's my challenge:

I'm processing a customer info file with your standard demographics -
first name, last name, age, address etc.

The last name appears in all of the 'last name' fields; no problem.
However, in some of the 'first name' fields the last name appears
again, like so:

F_Name          L_Name       Title
Kris Doft          Doft             Manager
Johan              Smith          Accountant
Maria Katson   Katson         Director
Anne Charles   Charles        Supervisor

Is there a query that can get rid of the duplicate last name in the
'first name' fields?

Obviously it can't be a standardised 'delete last 4 characters in
F_Name field' type of deal as both the first and last names will have
differing lengths in any given record.

I think I basically have to tell the database to 'delete any character
that comes after a space ' ' in the F_Name field, but I don't know how
to do that...

Um... help?
:)
Thanks
prodeji - 06 Nov 2007 17:36 GMT
Forgive me for doing this...

With the instruction posted here I came up with:

UPDATE TABLE_NAME SET TABLENAME.FIELDNAME1 = Left([FIELDNAME1],InStr(1,
[FIELDNAME1]," ")-1)
WHERE (((TABLENAME.FIELDNAME1) Like "* " & [FIELDNAME2]));

Can anyone help me 'transpose' this into Oracle(PL/SQL)?

I've started researching and so far I know 'Left' is replaced by
'SUBSTR' in Oracle but I'm under some serious duress timewise...

Thanks

> Hi all
>
[quoted text clipped - 27 lines]
> :)
> Thanks
 
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.