Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Remove file extension in SQL

Posted on 2003-11-24
3
Medium Priority
?
562 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

636 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