View Full Version : Simple Expression, Need Help


adam.greer
09-29-2006, 02:22 AM
Hi guys

I need to trim a section of text in a field in my DB. I'm currently using the following expression.

(Left(Mid([filename],InStrRev([filename],"\")),InStrRev(Mid([filename],InStrRev([filename],"\")),"")))

Which turns

D:\Broadcast\Music\A-C\Artcha\Artcha - Artcha - 1 - Hustle And Flow.mp3

Into

\Artcha - Artcha - 1 - Hustle And Flow.mp3

Now things have changed in the DB and and I need the query to return

\Artcha\Artcha - Artcha - 1 - Hustle And Flow.mp3

But when I change the query I can't get the expression to return it.

What am I doing wrong?

Thanks

ejstefl
09-29-2006, 07:40 AM
Try this:

Right([filename], Len([filename]) - InStrRev([filename], "\", InStrRev([filename], "\") - 1) + 1)

adam.greer
09-29-2006, 07:44 AM
Works great, thanks alot man.