• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

modifying multi image names

LEGEND ,
May 16, 2006 May 16, 2006

Copy link to clipboard

Copied

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


TOPICS
Advanced techniques

Views

287

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 16, 2006 May 16, 2006

Copy link to clipboard

Copied

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'

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 17, 2006 May 17, 2006

Copy link to clipboard

Copied

The same thing as ScareCrow, but for MS SQL Server:
UPDATE myTable
SET columnName = LEFT(columnName, LEN(columnName) - LEN('3.jpg') ) + '2.jpg'

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 17, 2006 May 17, 2006

Copy link to clipboard

Copied

The same thing as ScareCrow, but for MS SQL Server:
UPDATE myTable
SET columnName = LEFT(columnName, LEN(columnName) - LEN('3.jpg') ) + '2.jpg'

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 17, 2006 May 17, 2006

Copy link to clipboard

Copied

LATEST
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
>


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation