Solved

Remove file extension in SQL

Posted on 2003-11-24
3
557 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

831 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