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 / General 2 / March 2007

Tip: Looking for answers? Try searching our database.

Extract part of a text field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
2Blessed4Stress - 28 Mar 2007 21:08 GMT
I have a table with a column named "Remarks". All of the data looks like this:
EQ: 4803CAGEN001, OPERATION: HYDRAULIC,  LOC: ENGINE ROOM\\\\ LOWER
LEVEL\\\\ PORT\\\\ FORWARD\\\\  CRIT CODE: 0, TECH MANUAL INDEX: 178,

I only want to see the LOC:.....and stop at CRIT.

How do I export this information?
Semi - 28 Mar 2007 21:50 GMT
It is easiest to do this with a custom function.  But it can also be done
with a standard Query.  You will need to use the following built in text
functions:

Mid («stringexpr», «start», «length»)  
and
InStr («start», «stringexpr1», «stringexpr2», «compare»)

(the compare parameter is optional and I did not use it below.)

Cut & paste this into a Query
ExportStr:
Mid([Remarks],InStr(1,[Remarks],"LOC"),InStr(1,[Remarks],"CRIT")-InStr(1,[Remarks],"LOC"))

be careful of syntax, a extra , or ) will mess everything up.  

Good luck

> I have a table with a column named "Remarks". All of the data looks like this:
> EQ: 4803CAGEN001, OPERATION: HYDRAULIC,  LOC: ENGINE ROOM\\\\ LOWER
[quoted text clipped - 3 lines]
>
> How do I export this information?
2Blessed4Stress - 29 Mar 2007 20:56 GMT
Thank you very much!  That did it.  Now I just need to study how you did it,
so I'll know the next time.

> It is easiest to do this with a custom function.  But it can also be done
> with a standard Query.  You will need to use the following built in text
[quoted text clipped - 21 lines]
> >
> > How do I export this information?
 
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.