DeveloperBarn Forums

DeveloperBarn

Programming & IT forum

finding values

This is a discussion on finding values within the ASP Development forums, part of the Programming & Scripting category; Hi, I have a table the design is like this Id Description I want to find out if the tables ...

Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development

  #1  
Old June 21st, 2008, 10:10 AM
Barn Enthusiast
 
Join Date: Mar 2008
Posts: 462
Rep Power: 2
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
  #2  
Old June 21st, 2008, 01:36 PM
richyrich's Avatar
Administrator
 
Join Date: Mar 2008
Real name: Rich
Location: Somewhere only we know...
Posts: 1,342
Blog Entries: 6
Rep Power: 8
richyrich is a name known to allrichyrich is a name known to allrichyrich is a name known to allrichyrich is a name known to allrichyrich is a name known to allrichyrich is a name known to all
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  
Old June 23rd, 2008, 02:03 AM
don94403's Avatar
Moderator
 
Join Date: Mar 2008
Location: San Mateo, CA, USA
Posts: 146
Blog Entries: 8
Rep Power: 4
don94403 has a spectacular aura aboutdon94403 has a spectacular aura aboutdon94403 has a spectacular aura about
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


Similar Threads

Thread Thread Starter Forum Replies Last Post
Store Calculated Values (Updating Fields) sbenj69 Access Database Samples 9 January 12th, 2009 11:49 AM
retrieve values todd2006 SQL Development 5 June 19th, 2008 01:46 PM
Finding Datalist Row on auto postback richyrich .Net Development 1 May 12th, 2008 04:52 AM


All times are GMT -4. The time now is 06:19 PM.


Copyright ©2008-2010, DeveloperBarn

Content Relevant URLs by vBSEO 3.3.2