A SIMPLE QUERY1. Click on the 'Queries' Icon in the Navigotor Window. 2. Double Click on the 'untitled' icon. [You will now see the "OPEN TABLE REQUIRED" box.] 3. Click on the name of the table you want to querie. (Eg, cruise.dbf). [This will open the Query Designer Window showing a new query that is Untitled] We now need to Select which fields we want to view in our query. We will Use the Paid.dbf Table to use follow this example.
4. You will need to click on the box that is sitting under the key icon in the following fields. N.B. It is up to you which fields you wish to view. It depends on your needs. In this case for example we may simply want to view names and phone numbers, so that we can give the customers who have not yet paid, a phone call to remind them to pay up. We now need to select which records we want to view. In this case we wish to view a list of all the customers who have not paid for their cruise. 5. If you click on the small right arrow it will scroll across the screen until you come to the Paid field. This is the field of importance as we wish to view all customers who have NOT paid.[Remember that you have already placed a tick in the check box] 6. Now in the text box we need to add our conditions [This can only be that the customer has paid or has not paid]. In this situation we need to tell the query designer that we wish to view all cutomers who have not paid for their cruise. Because we have this field set up as a logical one we can place either a "T" or an "F" in the text box. T fir the customers that have paid. And F for those who have NOT paid. So we now place an N in the box. 7. Once we have informed dBase of our query specifications, we have to save the query. Press ctrl + S at the same time. This will bring up the Save File Box. You may now name your Query "nopay" and click on OK. Now we can run our query.Note there are two ways to run your query. This is one of them only. 8. After closing the query designer Window, in the Navigator Window click on "queries" where you will then see the files you previously saved (i.e. nopay.qbe). Right Click on the file name to bring up the "Mini Menu" and click on Run Query. [This will open the query Results table showing the fields you specified [i.e. Cust Number, First Name, Last Name, Ph_Number, Cost, Paid] for all the customers who have not yet paid for their tickets. Simple enough? Now lets look (Only look and not alter) the program code.
Lets move on to querying more than one table at a time! |