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 / Forms Programming / July 2006

Tip: Looking for answers? Try searching our database.

take parts of text

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
geebee - 31 Jul 2006 18:27 GMT
hi,

Let's say I have a field with this as the value:
"z:/daily/bk/DDR_DEFERM_BK.csv"

I would like to know how I can take the "z:/daily/bk/" part only.

Also, how do I replace the "/" with "\"?

Thanks in advance,
geebee
Jeff L - 31 Jul 2006 18:35 GMT
I would like to know how I can take the "z:/daily/bk/" part only.
Answer:  Left(YourFieldName,12)

Also, how do I replace the "/" with "\"?
Answer:  Do a find and replace on that field in your table.

Hope that helps!
Klatuu - 31 Jul 2006 18:53 GMT
x="z:/daily/bk/DDR_DEFERM_BK.csv"
x=replace(x,"/","\")
x=left(x,instrrev(x,"\"))

> hi,
>
[quoted text clipped - 7 lines]
> Thanks in advance,
> geebee
fredg - 31 Jul 2006 19:00 GMT
> hi,
>
> Let's say I have a field with this as the value:
> "z:/daily/bk/DDR_DEFERM_BK.csv"
>
> I would like to know how I can take the "z:/daily/bk/" part only.

I would assume the string length will vary.

Left(Your String or Field Name Here,InStrRev(Your String or Field Name
Here,"/"))

> Also, how do I replace the "/" with "\"?

Access 2000 or newer?
Replace(Your String or Field Name Here,"/","\")

To do both at the same time:

Replace(Left(Your String or Field Name Here,InStrRev(Your String or
Field Name Here,"/")),"/","\")

> Thanks in advance,
> geebee

Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

 
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



©2010 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.