#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    2
    Rep Power
    0

    Multi tier/field search


    Ok what im tring to do here is build a complex search for a forums database. Basically before you can post your required to select a year, make and model of car. Then you select a Vehicle system, Main Category, Subcategorey and Subcategory1. Then you are allowed to make a post. I am running a MS Access database with a OBDC driver through Cold Fusion Server.

    What is going to happen is once the post has been written before it displays your message back to you it will search the database for simalar entries. Where I think it gets tricky is that it cant match everything 100% if you know what i mean, and what i would like is a percentage or nuber of fields to be displayed. So it would say (5 out of 7 fields matched or 70% match) and display those results in a list. Now I have got the database up and can post with the year make model etc. but cant figure out this search, all i have been able to acomplish is a search with 100% results where if one thing doesnt match nothing shows up.
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,265
    Rep Power
    968
    Try using OR in your WHERE clause, instead of AND to get results that have any or all of the criteria. And look into using COUNT() in the SELECT clause (and a GROUP BY clause at the end) to get a count of records returned. And I'd advise grabbing a good book on SQL because problems like this will confront you again and again, and the only real solution is a firm grasp of SQL.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    2
    Rep Power
    0
    I think im going to try this extension, I have a few books on SQL but Im still learning. Thanks for the advice.

    http://www.webassist.com/Products/Pr...ils.asp?PID=11

IMN logo majestic logo threadwatch logo seochat tools logo