F – Queries, Mail Merges and Listings

F – Queries, Mail Merges and Listings

Estimated reading time: 1 min


The Query tool lets you select Clients, Patients or Visits that match specific search criteria. You can then use the output to generate mail labels, mail merge letters, or a list which you can print, email or export to another program such as Microsoft Excel.

You can use this report to manage your labels and targeting material.

Accessing Queries, Mail Merges & Listings

  1. Go to the RxWorks Task Panel.
  2. Select ‘Reports’ from the “toolbar”.
  3. Select ‘F: Queries, Mail Merges & Listings’

The window shown above will appear.

Select Listing

Select the type of listing you require: Clients, Patients, Consultations (Visits) or Transactions (Financial).

Building Your Selection Criteria

Choose the first restriction you wish to build your selection criteria with: Clients, Patients, Consult (Visits) or Financial.

From the list of database merge types, choose the second restriction you wish to build your selection criteria with.

Specify the criteria for the value you have chosen.

You can then enter a value. Sometimes the field will be a blank field (ie: address). In other cases, it will allow you to select from a drop-down list (ie: species). Some cases may restrict you to a certain format. (ie: date)

Once you have a value in this last field, click on the add button. Your selection criteria should now appear in the Selection Criteria box.

Building Reports with Multiple Criteria

You can add multiple criteria in the same way. Simply choose new selection criteria and click the ‘add’ button.
In this example we are searching for dogs over 10 years of age.

It is often a good idea to select Client > Bad Debtor Notes > Is Empty. In most cases you do not want to send promotional material to debtors or consistent bad-payers!

Executing Your Queries

Click ‘Execute’ to process your query. Once processing is complete, the program will show the number of records found.

Using Boolean Operators

There is no practical limit to the number of criteria you can use when running a query, but you do need to consider what the effect of combining criteria may be.
For example if you enter the following criteria for ‘Dogs and Cats over 10 years of age’ you will not get any result at all:
Date of birth <= 23/07/1999 Species = Dog Species = Cat The reason for failure is fairly obvious in such a short list: no patient can be both a dog and a cat. This is where Boolean operators come in.

What Is A Boolean Operator?

In layman’s terms, a Boolean Operator performs a union or intersection of two sets of data. Although there are many such operators, the program offers the two basic ones: AND and OR, along with some brackets to segment the query logic.
To correct the conflict in the above example, you would need to select the first line of your criteria (Species = Dog), and click on the ‘OR’ button.

But this is still not perfect, because it will now select patients who are dogs over 10 years of age or who are cats. That means it will include ALL cats!

Refining The Query

To refine the query that only selects dogs and cats over 10 years of age, you will need to ‘group’ the two species criteria. You can do this by placing them in brackets.

  1. Select the first species criteria (in this case, DOG).
  2. Click on the opening bracket button to the right.
  3. Select the last species criteria (in this case, CAT).
  4. Click on the closing bracket button to the right.

The query shown will find both dogs and cats over 10 years old.

Saving Your Query

If you have created a query you will probably use more than once, you can save it. That way, next time you need to run it, the template can be opened from the ‘Saved Queries’ folder.

To Save A Query

  1. Build the query.
  2. Click on the ‘Save’ button.
    • The ‘Save As’ dialog will appear.
  3. Save the Query with a meaningful name to a location on your computer.

How to Open Saved Queries

To make life easier, RxWorks have a number of pre-saved queries for you to open and use.

To Open A Pre-Saved Query

  1. Click on the ‘Open Query’ folder to the right of the criteria window.
  2. Choose the query you wish to open. The RxWorks Query Folder has many sub folders and categories to choose from.
  3. Click on Open.

Output Options for Your Queries

Select Output Style

In Section 3 of Report F, you choose what type of document you would like to create with the records the query found.

Output records as:

  • a .pdf report listing.
  • a word mail merge.
  • an excel spreadsheet.
  • Previewing The Output

    Output options will be shown depending on the style selected.

    Report Listing

    Here you can select the type of output for your listing.

    Choose to preview, print or setup the page styles by selecting ‘Preview’, ‘Print’ or ‘Setup’ respectively.

    Word Merge

    Here you can select from a variety of different Word documents to output your records to.

    1. Select to export to either a ‘Letter’, ‘Label’, ‘Form’, ‘Reminder’.
    2. Choose the specific document desired from the drop-down menu.

    The choice of documents available is dependent on the type of output selected. If you chose Client you get a choice of client letters, if you chose Patient or Visit you get a choice of patient letters.
    After selecting your document type you can chose to preview the document in Microsoft Word or directly output it to the printer, email, fax or SMS.

    Excel Spreadsheet

    Here you chose to export your records to an Excel Spreadsheet with either just basic details or with the data from custom fields

    Click ‘Preview’ when you’re ready to export your data to Microsoft Excel.

    Was this article helpful?
    Views: 0