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?

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"

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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.