take parts of text

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

Guest

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
 
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!
 
x="z:/daily/bk/DDR_DEFERM_BK.csv"
x=replace(x,"/","\")
x=left(x,instrrev(x,"\"))
 
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,"/")),"/","\")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top