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 December 28th, 2005, 07:26 PM
Authorized User
 
Join Date: Sep 2003
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Default Search separate C from CR

HI,

I am using this sql statement in ASP using access

strSQL = "SELECT * FROM singles " & "WHERE fleet LIKE '%" & Replace(strSearch, "'", "''") & "%' "& "ORDER BY " & strOrderBy & ";"

Which works fine except If I look for C
I also get records including CR and LTC

Must be something simple I guess

Thanks

Roy..,
 
Old December 29th, 2005, 05:19 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Roy,

You should drop the percentage characters. Searching for '%C%' finds anything that contains a C anywhere.

Searching for 'C' instead searches for an exact match of C....

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old December 29th, 2005, 08:58 AM
Authorized User
 
Join Date: Sep 2003
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you so much, fixed in a flash

Kind regards

Roy..





Similar Threads
Thread Thread Starter Forum Replies Last Post
separate a string with whitespace petergoodman XSLT 8 July 8th, 2008 01:56 AM
How to separate Multiple InvoiceNos of one Receipt Rg2005 SQL Server 2005 0 October 19th, 2007 02:29 AM
How to separate Multiple InvoiceNos of one RecID Rg2005 SQL Server 2005 0 October 19th, 2007 01:54 AM
Two separate menu from one sitemap? KieshaJ310 ASP.NET 2.0 Basics 5 July 4th, 2007 01:31 AM





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