Jump to main Content | Jump to main Navigation

Command Line Searching

The Command Line Search dialogue box is useful for searching specifically on a field which does not feature in the main Query by Form and for specifying advanced searches. 

The Command Line Search option is available from the Archive and Museum Catalogue Menus.

While you are viewing a record the Command Line Search box can be accessed by pressing the F6 key on your keyboard or choosing the Search... option from the Search drop down menu.

In addition to the search buttons such as Find, Widen, Narrow and Exclude which function as in the Query by Form, the Command Line Search box contains buttons called Field... and History.

Field...

The Field... button allows you to search specifically on any field in the database.

When you click the Field... button the Choose Field dialogue box appears, as shown.

Select a field to search on by clicking the fieldname to highlight it and click OK. Note that the text box in the Search form now reads: Fieldname=. Now type the field contents you wish to search for: e.g. Repository=Museum

Click the button to run the search

History

Once you have conducted some searches using the Command Line Search facility you may click on the button in the Search dialogue box to view a list of the last 20 successful Command Line Searches. Click on one of these searches in the list, then click Find to run the search again.

Table of Command Line Search Conditions

   Search condition                  Finds records that:

¬ Cat         do not include Cat
(Cat) & (Dog)             include both Cat and Dog
(Cat) | (Dog)  include either Cat or Dog (or both)
¬ (Cat) & (Dog)   do not include Cat, but do include Dog
(records that include both Cat and Dog WILL NOT be found, because they include Cat)
¬ (Cat) | (Dog)      do not include Cat, or do include Dog
(fields that include both Dog and Cat WILL be found, because they include Dog)
¬ (Cat) ¬ (Dog)       include neither Cat nor Dog
(Cat) | (Dog) | (Mouse) include either Cat or Dog or Mouse (or all)
(Title=Cat) | (Title=Dog) include all records that have either Cat or Dog in the Title field

Comparative Searching

You can use the search conditions =, ==, <>, ><, >, <, >= and <= to select records which meet a range of values. The = and == can be used generally with any field but the > and < options only work with Date and Number fields. They are most likely to be used with particular fields, e.g. Date>1/1/89

You can use the following to extract records whose fields match a range of conditions in the Command Line Search dialogue

=           Equal to
==                        Exactly matches
<>  Not equal to
><   Does not exactly match
<          Strictly less than
>                Strictly greater than
<= Less than or equal to
>= Greater than or equal to

These functions may be used with both number and text values as in the examples below:

  Search condition                           Finds records:

Created>31/12/89          that were created after 1989
(Date<=1/1/1990) &(Salary>£25000.00) that have a date before 1/1/1990 and a salary greater than £25,000
(Admin) & (StartDate>1/1/90) that contain the word "Admin" in any text fields and have a Start Date after 1/1/90
Surname>=W   of all people whose surnames begin with W, X, Y or Z
City==York         where the city field contains only the text York (and, for example, not records where the city field contains New York).

Phrase Searching

Words that are next to each other in a record can be searched for by typing them into a search dialogue box as they appear in a record. For example, to narrow an existing hit list to contain only the records that contain the phrase black car, type 'black car' into the Search for records containing box and click OK.

The apostrophe or single quote signifies the start of a search term. If you wish to search for a term containing an apostrophe itself, for example you wish to search for two o'clock, you will need to use a space instead of the apostrophe, in this case type  'two o clock'

Phrase search commands can include stopwords, for example 'Erik the Viking', but the search command cannot contain only stopwords: 'the' would not be found. Stopwords in phrase searches will not be highlighted on the screen.

Search Order

The correct parentheses must be used to make the search order of a complex search expression explicit.

For example, if you wanted to find all people with a Title of Mr who either have a salary of more than £20,000 or work in the Accounts department

(Title='Mr') & (Salary>20000) | (Department='Accounts')

would not work correctly, but the following would

(Title='Mr') & ((Salary>20000) | (Department='Accounts'))

In the absence of enough parentheses, the precedence order is:

             ¬          NOT    (evaluated last)

            &          AND

            |           OR      (evaluated first)

Two identical operators at the same level are evaluated left to right.