take parts of text

G

geebee

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
 
J

Jeff L

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!
 
F

fredg

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,"/")),"/","\")
 
Top