Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 31st, 2005, 02:16 AM
Friend of Wrox
Points: 686, Level: 9
Points: 686, Level: 9 Points: 686, Level: 9 Points: 686, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Kolkata, West Bengal, India.
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.
Reply With Quote
  #2 (permalink)  
Old May 31st, 2005, 07:39 AM
Authorized User
 
Join Date: Jul 2004
Location: Hyderabad, Andhra Pradesh, India.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 04:10 AM.


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