Results 1 to 2 of 2

Thread: Filter Search

  1. #1
    Join Date
    Dec 2003

    Unanswered: Filter Search

    I know this is a very basic question, so please bear with me.
    I've built a search function. There are three parameters. I would like the user to search any one or a combination of these parameters.

    The parameters filter the recordset and I do not know how to structure the filters to allow a default set through, depending on the parameter option the user selects.

    I know I may need to use "OR" in addition to "AND" to get the result I need.

    Here is my SQL:

    SELECT Properties.PropertyID, Properties.Name, Properties.TownOrResort, Locations.TownOrResort, Properties.Ranking, Ranking.Ranking, Properties.Photo1, Amenities.Type, Amenities.Bedrooms, Amenities.Sleeps, Properties.DateRange1, Properties.DateRange2, Properties.DateRange3, Properties.DateRange4, Properties.DateRange5, Properties.DateRange6, Properties.PriceRange1, Properties.PriceRange2, Properties.PriceRange3, Properties.PriceRange4, Properties.PriceRange5, Properties.PriceRange6
    FROM Properties, Amenities, Locations, Ranking
    WHERE ((((Properties.PropertyID = Amenities.PropertyID) AND (Properties.TownOrResort = Locations.LocationID)) AND (Ranking.RankingID = Properties.Ranking)) AND ((Properties.TownOrResort = MMColParam) AND (Amenities.Type = 'MMColParam2')))
    ORDER BY 4 ASC, 2 ASC, 6 ASC, 9 ASC

    Thanks for any help you can lend.

  2. #2
    Join Date
    Aug 2003
    DEFINE myParam = 'S%';

    SELECT * FROM emp WHERE ename LIKE '&myParam'

    Will extract two records from the scott.emp table, both whose names
    begin with the letter 'S'.

Posting Permissions

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