Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do I delete all the text from a database field up to a ?

Posted on 2006-06-21
6
Medium Priority
?
174 Views
Last Modified: 2010-04-05
Hi,

I have a field called description in a database table, within the field is a ?, I want to delete all the text up to the ? and leave the rest.

Help needed.

Many thanks
Asw
0
Comment
Question by:Asw
[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
  • 2
  • 2
6 Comments
 
LVL 10

Expert Comment

by:atul_parmar
ID: 16950731
This will work for Access.

update tablename
set description = mid(description, instr(description, "?")+1)

If you are using other database just replace the mid and instr function with similar one.
0
 
LVL 1

Author Comment

by:Asw
ID: 16950941
Hi atul_parmar,

I'm using DBIsam, but I'll give it a try.

Thanks
Andy
0
 
LVL 15

Expert Comment

by:mikelittlewood
ID: 16951061
I think the MSSQL version would be something like this if you have similar

UPDATE tablename
SET description = SubString(description, CharIndex('?', description) +1, Len(description))
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 10

Accepted Solution

by:
atul_parmar earned 500 total points
ID: 16951100
For DBIsam,
UPDATE tablename
SET description = SubString(description, POSITION('?', description) +1, Length(description))
for SQL referance see http://www.elevatesoft.com/dbisam4d5_sql_reference.htm
0
 
LVL 15

Expert Comment

by:mikelittlewood
ID: 16951233
ah so just have to replace CharIndex with Position in mine, nice.
0
 
LVL 1

Author Comment

by:Asw
ID: 16951583
Hi Guyz,

Thanks for putting me in the correct direction.

I'll give the points to atul_parmar, because I got the info from http://www.elevatesoft.com/dbisam4d5_sql_reference.htm

This does the trick:
UPDATE Products
SET description = SubString(description from POS('?' in description)
+1)

Thanks
Andy
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

670 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