Solved

Remove file extension in SQL

Posted on 2003-11-24
3
558 Views
Last Modified: 2012-05-04
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
Comment
Question by:Orroland
  • 2
3 Comments
 
LVL 9

Expert Comment

by:svenkarlsen
ID: 9811055
Hi Orroland,

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


Kind regards,
Sven
0
 
LVL 39

Expert Comment

by:stevbe
ID: 9811071
create a new field and run an update query ...

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

Steve
0
 
LVL 9

Accepted Solution

by:
svenkarlsen earned 500 total points
ID: 9811085
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question