Skip to main content
Inspiring
May 17, 2006
Question

modifying multi image names

  • May 17, 2006
  • 2 replies
  • 401 views
Hi All

I'm wondering if anyone can help with this. I have a field in my database
that holds about 2000 image name. Each image ends with the characters 3.jpg
E.G. MyImage3.JPG

what I am trying to do is create an Update query to changes each of the
image names from MyImage3.jpg to MyImage2.jpg

I've been trying with an output query to an update query but I can't seem to
get the part of trimming the 3.jpg off and adding the 2.jpg.

Any ideas would be greatly appreciated.

Bill


This topic has been closed for replies.

2 replies

Inspiring
May 17, 2006
Perfect. That's what I was after.

Thanks a million

Bill


"DataPacks.com" <webforumsuser@macromedia.com> wrote in message
news:e4e0im$fkg$1@forums.macromedia.com...
> Hi All
>
> I'm wondering if anyone can help with this. I have a field in my database
> that holds about 2000 image name. Each image ends with the characters
> 3.jpg
> E.G. MyImage3.JPG
>
> what I am trying to do is create an Update query to changes each of the
> image names from MyImage3.jpg to MyImage2.jpg
>
> I've been trying with an output query to an update query but I can't seem
> to get the part of trimming the 3.jpg off and adding the 2.jpg.
>
> Any ideas would be greatly appreciated.
>
> Bill
>


Inspiring
May 17, 2006
This will depend upon which db your using.

But, something like the following will be close in ms access

Update myTable
Set columnName = Left(columnName, InStr(columnName, '3.jpg', 1)) + '2.jpg'
Inspiring
May 17, 2006
The same thing as ScareCrow, but for MS SQL Server:
UPDATE myTable
SET columnName = LEFT(columnName, LEN(columnName) - LEN('3.jpg') ) + '2.jpg'