EDITING QUERIES

Note:  The following screenshots are taken from the Patient sample application which can be downloaded HERE:

Move to the QUERIES tab.  

We’ve just realized that our MyPatients query does not show us the ROOM# of our patients. 

No problem!  We’ll just edit the query, and add the field.

Let’s select the MyPatients query that we just created in the previous section.

Click EDIT.

Notice that when ‘editing’ an existing query, you cannot use the Query-Builder.  You will either need to edit your SQL statement manually, or if you wish, you can click BUILDER and start from scratch.

In this case, we’re going to simply add the ROOM field to our results.  We do this by changing our SQL to the following:

SELECT  [Patients].[FirstName], [Patients].[LastName], [Patients].[Room] FROM [Patients] WHERE (([Patients].[FirstName] = 'Tery') AND ([Patients].[Active] = True) ) 

Click SAVE, and voila!  Your MyPatients Query will now display the names AND room numbers.