• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 565
  • Last Modified:

Remove file extension in SQL

I have a table containing product image file names.  I need to add '_small' to each file name to display the thumbnail.  I need to do this in the query, any ideas.

Eg

Original file: image.jpg

New file: image_small.jpg
0
Orroland
Asked:
Orroland
  • 2
1 Solution
 
svenkarlsenCommented:
Hi Orroland,

UPDATE tblName SET tblName.fldName = tblName.FldName & "_small";


Kind regards,
Sven
0
 
stevbeCommented:
create a new field and run an update query ...

left$(instr([imagefieldname],"."-1)) & "_small.jpg"

Steve
0
 
svenkarlsenCommented:
Orroland,

Sorry, - I didn't see this part:

Original file: image.jpg

New file: image_small.jpg


UPDATE tblName SET tblName.fldName = left(tblName.FldName,len(tblName.FldName)-4) & "_small" & ".jpg";

Replace tblName and fldName in accordance with your table.


Regards,
Sven
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now