Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics 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 16th, 2006, 04:32 PM
Friend of Wrox
 
Join Date: May 2005
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default search first letter

I have a table it has a country field
I need to return the fields with the FIRST Letter for ex C
here is my query:
strAlpha="C"
if strAlpha <> "" then
set rsCountry=server.createobject("adodb.recordset")
RsCountry.Open "SELECT * from cmm_country where country_name like '%" & strAlpha & "'",conn,3,3
end if


 
Old May 16th, 2006, 07:07 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try reversing that:
SELECT * from cmm_country where country_name like '" & strAlpha & "%'",

Woody Z http://www.learntoprogramnow.com
 
Old May 17th, 2006, 01:47 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks a lot.it worked






Similar Threads
Thread Thread Starter Forum Replies Last Post
Letter replace in hangman. martoufmarty Javascript How-To 12 June 17th, 2008 12:30 AM
Invert letter case martoufmarty Javascript How-To 4 June 8th, 2008 08:45 PM
check if first char is a letter crmpicco Javascript How-To 7 October 20th, 2005 05:42 AM
I have records where I need to replace one letter gilgalbiblewheel Classic ASP Databases 2 March 11th, 2005 02:29 AM
Obtaining a variable from the first letter... starsol Beginning PHP 3 August 18th, 2003 01:49 PM





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