0

Hi,

I have an insert statement that i need to refine...basically I need to trim the first couple of letters of whats trapped inthe field.
so e.g.

Z:\aaa\1.jpg

needs to become

aaa\1.jpg

Im tried this but its not working

sImagelink = mid(request.form("Imagelink"),4,len(request.form("Imagelink")))

any ideas?

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by kegathor
0

Use the SUBSTRING function.

SELECT SUBSTRING(ImageLink, 2, 100) FROM TheTable -- the 2 indicates start at index of 2, the 100 will give you the next 100 characters in the string "ImageLink"
0

Use the SUBSTRING function.

SELECT SUBSTRING(ImageLink, 2, 100) FROM TheTable -- the 2 indicates start at index of 2, the 100 will give you the next 100 characters in the string "ImageLink"

FYI, got it working kind of using this code

sImagelink = right(request.form("Imagelink"),len(request.form(" Imagelink")) - 3)

Now something else seems to have reared its ugly head...While it strips the first three characters of the string on one machine e.g.

Z:\aaa\image.jpg to aaa\image.jpg

on another machine its not bringing through the path and skimming the first 3 letters of jpg name e.g its returning ge.jpg.

Any ideas why this may be happening?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.