+ Reply to Thread
Results 1 to 3 of 3

Thread: finding values

  1. #1
    Barn Loyal todd2006 is an unknown quantity at this point todd2006's Avatar
    Join Date
    Mar 2008
    Posts
    889
    Rep Power
    4

    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

  2. #2
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    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.

  3. #3
    Moderator don94403 is a jewel in the rough don94403 is a jewel in the rough don94403 is a jewel in the rough don94403's Avatar
    Join Date
    Mar 2008
    Location
    San Mateo, CA, USA
    Posts
    313
    Blog Entries
    8
    Real Name
    Don Ravey
    Rep Power
    6

    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 to Thread

Similar Threads

  1. Store Calculated Values (Updating Fields)
    By sbenj69 in forum Access Database Samples
    Replies: 9
    Last Post: January 12th, 2009, 11:49 AM
  2. retrieve values
    By todd2006 in forum SQL Development
    Replies: 5
    Last Post: June 19th, 2008, 02:46 PM
  3. Finding Datalist Row on auto postback
    By richyrich in forum .NET Development
    Replies: 1
    Last Post: May 12th, 2008, 05:52 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO