Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 31st, 2005, 02:16 AM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default Trimming a query for search

Hi,
I have a table named doctor where there is a field called doctorname where the names are like Dr. ABC, Dr. BCD . I have a search page where I can give an alphabet by which the doctor name is searched from the table containing the alphabet. But when i am giving the alphabet 'D' or 'r' or '.' the search result is returning all the names since the names are stored with the prefix Dr. . I have used like for searching names. What can i do to trim the first Dr. from the SQL query itself. any code will help.
 
Old May 31st, 2005, 07:39 AM
Authorized User
 
Join Date: Jul 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to raj_makro
Default

Hi
  you can use
   mid(doctorname,4) like '<searchstring>'
         - for access database and
   substring(doctorname,4,len(doctorname)-4) like '<searchstring>'
         - for SQL database


Regards
Raj





Similar Threads
Thread Thread Starter Forum Replies Last Post
Trimming String MacDevv C# 2005 5 May 6th, 2008 08:55 AM
Trimming Words Nicky_uk Classic ASP Databases 5 February 21st, 2008 02:06 PM
Query to Search for a value in a table Vendirella SQL Language 0 October 10th, 2007 12:47 AM
query name search dstein4d Access VBA 1 August 13th, 2007 12:19 PM
Site map security trimming. weisma BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 5 December 25th, 2006 11:57 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.