Solved

Remove file extension in SQL

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now