DeveloperBarn Forums

Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development

Discuss "finding values" in the ASP Development forum.

ASP Development - Learn coding practices and tips to get the best out of your Active Server Pages (ASP). The Classic ASP forum is for ASP/VBScript and ASP/JScript applications.


Reply « Previous Thread | Next Thread »  
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old June 21st, 2008, 10:10 AM
Contributing Member

 
Join Date: Mar 2008
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default finding values

Hi,

I have a table the design is like this

Id
Description

I want to find out if the tables description field has any values that start with

Sem-Conf

And if so then display all the values that start with Sem-Conf

So say for example it will hold values like this

Sem-Conf Discussion making for kids
Sem-Conf Teach kids about maths


So when i display the values i only want to display


Discussion making for kids
Teach kids about maths

I tried the % in sql but it didnt work

any idea

todd
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old June 21st, 2008, 01:36 PM
richyrich's Avatar
Moderator

 
Join Date: Mar 2008
Location: Somewhere only we know...
Posts: 325
Thanks: 22
Thanked 23 Times in 23 Posts
Rep Power: 1
richyrich is on a distinguished road

Awards Showcase
Classic ASP JavaScript 
Total Awards: 2

Default

It should be something like:-
Code:
strsql = "SELECT Id,Description WHERE Description LIKE 'Sem-Conf%'"
.
.
.
.
.
if not rs.eof then
do until rs.eof
response.write(replace(rs("Description"),"Sem-Conf ",""))
rs.movenext
loop
end if
Is that what you tried?

Hope that helps.
Reply With Quote
  #3 (permalink)  
Old June 23rd, 2008, 02:03 AM
don94403's Avatar
Moderator


 
Join Date: Mar 2008
Location: San Mateo, CA, USA
Posts: 43
Thanks: 2
Thanked 3 Times in 3 Posts
Blog Entries: 2
Rep Power: 1
don94403 is on a distinguished road

Awards Showcase
Microsoft Access PHP 
Total Awards: 2

Default

As I responded in the other forum about your database, you have an underlying flaw in the design of your table. It violates First Normal Form, in that you are coding more than one piece of data in the same field. In a properly designed table, every data field should be "atomic"--a single indivisible value. Then you wouldn't be having this problem.
Reply With Quote
Reply

  DeveloperBarn Forums > Programming & Scripting > ASP Development

Bookmarks

Thread Tools
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
retrieve values todd2006 SQL Development 5 June 19th, 2008 01:46 PM
Store Calculated Values (Updating Fields) sbenj69 Microsoft Access 6 May 26th, 2008 10:18 AM
Finding Datalist Row on auto postback richyrich .Net Development 1 May 12th, 2008 04:52 AM


Sponsored Links

ASP.NET Resource Index
a directory of ASP.NET tutorials, applications, scripts, assemblies and articles for the novice to professional developer.

Free Web Directory
Including Chats and Forums Resources, Offer automatic, instant and free directory submissions.
URLZ Web Directory
URLZ Web Directory

Free Web Directory - Add Your Link
The Little Web Directory
Free Web Directory
Pegasus free web directory is a free directory organised by categories.

Web Directory & SEO Services
dirroot web directory


All times are GMT -4. The time now is 10:40 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Copyright © 2008 DeveloperBarn.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46