3.2.4. User Generated Query (restricted). 



If none of the options available in the menus for query condi- 

 tions fit the needs of the desired report, the system allows for the con- 

 struction of an AD-HOC query condition. You may enter these ad-hoc queries 

 in two different ways. This choice allows you to use menus to construct an 

 ad-hoc query. The next choice allows you to type in your query directly 

 in dBase III code. The second choice, described below, is recommended for 

 most queries; although it requires you to understand some dBase III code, 

 it allows you to construct very powerful boolean search conditions. 



Because you and not the system are constructing the query, you must 

 obey certain grammatical rules for your AD-HOC query to function. For 

 example, dBASE III allows what is known as a "substring" search". You have 

 seen the construction of a substring search in the County Query. The 

 operator for a substring search is the "$". The use of this search 

 condition requires precise grammatical construction. 



For example, suppose you wish to search the field "STATUS" in the 

 Natural Features data base for the condition "RNA". The actual query condi- 

 tion command would be: 



SET FILTER TO 'RNA' $STATUS 



The data management system will construct the actual command for you, 

 however, it WILL NOT supply the proper punctuation, you must do this your- 

 self. Another example may be that you want to create a query condition 

 such that only records in Missoula county with a value class less than 2 

 are reported. The query condition would be similar to: 



SET FILTER TO 'MISS.' $COUNTY .AND. OVERALL <"2" 



Again, the system AD-HOC query generator will construct tfie correct 

 command IF you supply the proper punctuation. 



In General, the system will not supply single quotes "'" or paren- 

 theses "0". 



NOTE: DO NOT USE THE DOUBLE QUOTATION MARK ' " ' 



The data management system will accept them in the AD-HOC construc- 

 tion, but will abort the system if they are used! 



Values that are acceptable to the AD-HOC query generator will be 

 displayed in the lower section of the display. These fields are the 

 variables identified as the query condition variables. Be careful 

 in the spelling. An incorrect field name will not function correctly. 



An example of the figures depicting a typical AD-HOC query input 

 screen is on the following page. 



3-8 



