Solved

creating search criteria

Posted on 1998-07-26
1
174 Views
Last Modified: 2013-11-20
hello, i am currently trying to set up a search of a database on multiple fields. how would i go about
doing this without using any data from the database. example setting up a minimum and maximimum
price amount where i have a field called price, want to search with parameters, say they are looking
for a 55,000.00 house, i want to search for all houses between the range of 45,000.00 and
65,000.00. is there an easy way of doing all that i want.
0
Comment
Question by:borggies
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 7

Accepted Solution

by:
psdavis earned 50 total points
ID: 1319762
I am assuming a DAO or a ODBC database...

In DAO (probably ODBC as well) you can either create a CDaoQueryDef or set the m_strFilter parameter of a CDaoRecordset.

Setting the m_strFilter parameter...

m_strFilter.Format( "WHERE [Price Range] IS BETWEEN %d and %d", iLowPrice, iHighPrice );

and then a CDaoRecordset::Requery( )

should do the trick for you.  You can do a CDaoQueryDef by adding it to your database (via Access) and allowing the low and high prices to be parameters (look it up in a TechNote, it's pretty well laid out)

Phillip

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question