SEARCH selection (Do you want to limit the list by searching for something?)
You can limit the size of the report by telling report generator only
to add details to the list when they meet specific criteria, e.g.
only list canines / only use small animal (SA) records, list only
goods from Genus, etc.
Premvet 5 will display the following screen:
|----------------------------------------------------------------------|
| Dummy Practice New report - SEARCH selection |
|----------------------------------------------------------------------|
|---------Selection box----------| |-------Selected options-------|
| Description | | |
| Prac ref. * | |
| Supp ref. | | |
| Product code | | |
| Supplier code | | |
| Manuf. code | | |
| Cost (Pack) | | |
| Cost (Actual) | | |
| Pack contents | | |
| Quantity | | |
| Dose | | |
| Seasonal (Start) | | |
| Seasonal (Finish) | | |
| Flag | | |
| Data | | |
| Vat Rate | |------------------------------|
| Special |
|--------------------------------|
If you do not want to search for anything you can just press
RETURN and this section is ignored.
The search criteria can be based on any field or combinations of fields and these are completely unrelated to any earlier selection.
Field selection takes place in a similar manner to the earlier printout and sort selection.
Entering search criteria
If a search criteria has been selected the screen
will display a list of the selected fields allowing you to enter
in the appropriate line what you want to search for e.g. to
search the species field for all canines you may enter 'CANINE'.
If some of your canine records have different entries in the
species field, like dog, K9, canis etc., you can tell report generator
to search for these permutations as well.
You just enter on the species line 'CANINE,DOG,CANIS,K9' and this will match
any record where the species field starts with any of these four codes.
Search operations
The following is a summary of the various options (operands) that
can be used while performing a search.
? Matches any one character $ Contains = Equal to <> Not equal to > Greater than < Less than >= Greater than or equal to % OR <= Less than or equal to ^ AND / Ask when the report is run ! Negate
Note: If you like, you don't have to choose the search criteria at this point. By entering a forward slash '/' you tell the report generator that the search criteria will be entered when the report is run.
Note: You do not need to worry about whether the text you are searching for is in upper or lower case. All search comparisons will take place in UPPER case irrespective of what you are searching.
Note: Depending on a set of in-built rules the content of fields being searched may be converted into a number. The search routine will alter its method of search based on this so some of these operands may make no sense. For example, while searching stock quantity, which is a numeric field you would be unlikely to search for the text 'LOTS'. You are allowed to do this, but you will get unexpected results. In this case the text 'LOTS' will be given the numeric value of zero '0', and when compared numerically this may match and the record will be selected.
NO Operand. If NO operand is specified then the number of characters entered will be compared with the SAME number of characters in the field being searched. If they are the same then a match will be assumed and this is the simplest search to use e.g.
Search criteria | Field | Match
-------------------|----------------------|--------
MEL | Melvin,Mr Tom | YES
| Melville Mrs | YES
| Jones, Miss | NO
| |
PENICILLIN | Penicillin 100Mg | YES
| Penicillin 20 Mgs | YES
| |
MR MEL | MR T MELVIN | NO
| |
100 | 100.12 | YES
| 10.00 | NO
| 100 | YES
e.g. To list all the clients on file with the name SMITH you would search criteria SMITH beside client name. This will ignore any text to the right of the word smith therefore ignoring the first name and title.
? - Matches any one character. The ? operand will match any one character while it will work with numeric fields, its main use is searching alphabetical fields and looking at stock flags e.g.
Search criteria | Field | Match
-------------------|----------------------|--------
M?L | Melvin,Mr Tom | YES
| Milligan Miss | YES
| Mellville | YES
| |
M?L?I | Melvin,Mr Tom | YES
| Mellvile | NO
| Melville | YES
| |
???ICILLIN | Penicillin 100Mg | YES
| Ampicillin 5 mg | YES
| |
M??G | MacGreggor | YES
| MacGreen | YES
| McGreen | NO
| Mc Green | YES
e.g. You want a list of all clients that have been marked for
archiving (thay have 1R, 2R, 3R, 4R in the status field). You
would use a search criterion ?R beside the status field.
$ - Contains the characters. The $ operand will compare the field being searched and if the search criteria appears ANYWHERE within it a match will be made e.g.
Search criteria | Field | Match
-------------------|----------------------|--------
$MEL | Melvin,Mr Tom | YES
| Milligan Miss | NO
| Mellville | YES
| Scammel | YES
| |
$IN | Penicillin 100Mg | YES
| Ampicillin 5 mg | YES
| Aspirin | YES
| |
$10 | Aspirin 100 mg | YES
| 100 High Street | YES
e.g. You want a list of all client living in 'Main Street' you
would use a search criterion $MAIN STEET for the 1st address
field. This will ignore any street number preceding the road
name. You can combine the ? and $ on the same line. To find
everyone who lives between 20 and 29 Main street, you could enter
$2? MAIN STREET
= - Equal to. The = operand will compare the search criteria with the field. This is the same as the NO operand with one important difference - the length of the field and search criteria are taken into consideration. Therefore the search criteria must be IDENTICAL to the field before a match is made. NOTE: Spaces at either end will be ignored. When used with numeric fields a direct comparison is made and this is its main use.
Search criteria | Field | Match
-------------------|----------------------|--------
=MELVIN | Melvin | YES
| Melvin Mr | NO
| |
=PENICILLIN | Penicillin 100Mg | NO
| Penicillin | YES
| |
=100 | 100.00 | YES
| 100 | YES
| 100.50 | NO
| 100 Main Street | NO
e.g. To list all stock items with a minimum quantity of 10. B
Beside 'minimum quantity' you would enter the criteria '=10'. This will ignore
any records where the minimum figure is not exactly 10.
<> - Not equal to. The field is compared with the search criteria and if they are NOT the same then a match is assumed. This is usually used only with numeric fields but can be used with alphabetical ones as well e.g.
Search criteria | Field | Match
-------------------|----------------------|--------
<>12 | 13.56 | YES
| 8.11 | YES
| 12 | NO
| |
<>MELVIN | MELVIN | NO
| MELVIN,Mr Tom | YES
e.g. You want a list of clients that owe you money. This is
done by entering <>0 beside the balance due field.
> - Greater than. If the field is greater than the search criteria then a match is assumed. This is usually used only with numeric fields but can be used with alphabetical ones as well e.g
Search criteria | Field | Match
-------------------|----------------------|--------
>12 | 13.56 | YES
| 8.11 | NO
| 12 | NO
| 12.01 | YES
| |
>MELVIN | MELVIN | NO
| ANDERSON,Mrs | YES
e.g. You want a list of clients that are owe you more then
-1000.00, the search criteria beside balance due would be >1000.
>= - Greater than or equal to. If the field is greater than or equal to the search criteria then a match is assumed. This is usually used only with numeric fields but can be used with alphabetical ones as well e.g.
Search criteria | Field | Match
-------------------|----------------------|--------
>=12 | 13.56 | YES
| 8.11 | NO
| 12 | YES
| 12.01 | YES
| |
e.g. You want a list of all stock items where there are 10 or more
in stock. The search criteria beside quantity would be >=10.
< - Less than. If the field is less than the search criteria then a match is assumed. This is usually used only with numeric fields but can be used with alphabetical ones as well e.g.
Search criteria | Field | Match
-------------------|----------------------|--------
<12 | 13.56 | NO
| 8.11 | YES
| 12 | NO
| 12.01 | NO
| |
<G | MELVIN,Mr Tom | NO
| ANDERSON | YES
<= - Less than or equal to. If the field is less than or equal to
the search criteria then a match is assumed. This is usually used
only with numeric fields but can be used with alphabetical ones
as well e.g.
Search criteria | Field | Match
-------------------|----------------------|--------
=<12 | 13.56 | NO
| 8.11 | YES
| 12 | YES
| 12.01 | NO
| |
! - Negate operation. This operand NEGATES the match - if
the search criteria match and this operand is also used then
there is NO match and vice versa e.g.
Search criteria | Field | Match
-------------------|----------------------|--------
!MEL | Melvin,Mr Tom | NO
| Melville Mrs | NO
| Jones, Miss | YES
-------------------|----------------------|--------
!$MEL | Melvin,Mr Tom | NO
| Milligan Miss | YES
| Mellville | NO
| Scammel | NO
-------------------|----------------------|--------
!=MELVIN | Melvin | NO
| Melvin Mr | YES
| MELVILLE | YES
-------------------|----------------------|--------
!<>12 | 13.56 | NO
| 8.11 | NO
| 12 | YES
-------------------|----------------------|--------
!>12 | 13.56 | NO
| 8.11 | YES
| 12 | YES
| 12.01 | NO
When used with numeric comparisons you can use the equivalent
mathematical symbol instead e.g. = and !<> both mean equal to and
!= and <> both mean NOT equal to. There is no difference in
execution time from one method to another.
/ - Ask later. You may decide to set-up a basic report and alter the search criteria each time it is run e.g. all dogs then all cats, then neither of the two. While it is possible to edit the report each time (or create separate reports) there is an easier way. That is, when you are asked to enter the search criteria you enter an forward slash '/'. This tells the report generator to ask you each time the report is run to enter the appropriate details. After you have answered all the questions relating to record to start and finish at, report output the screen will clear and show you all the fields with a /. You enter at this point the search criteria as in the previous examples. This criteria will be used this time only and NOT saved, the next time the report is run you will again be asked for what you want to search for.
Multiple search criteria on a single item
So far we have dealt only with simple search criteria. You can specify multiple criteria on one line, each criteria separated with a comma ',' e.g. =MEL,$IN. Each of the criteria will be compared with the field in turn and if at least one matches then the record will be selected e.g.
Search criteria | Field | Line | Match
-------------------|----------------------|----------|-----
MEL,$TOM | Melvin,Mr Tom | YES |
| Melville Mrs | YES | Y
| Jones Tom | YES | E
| Smith, Mrs | NO | S
| MR MELVIN | NO |
ANDER,=MEL | Melvin,Mr Tom | NO |
| Melville Mrs | NO | N
| Jones Tom | NO | O
| Smith, Mrs | NO |
| MR MELVIN | NO |
The default mode of operation is : If at least one criterion
matches then there is an overall match. There are two operands
which affect multiple search criteria.
% - OR. The percentage operand means 'OR' and is used to indicate if one OR other of the criteria is met but NOT both e.g.
Search criteria | Field | Line | Match
-------------------|----------------------|----------|-----
MEL,%$TOM | Melvin,Mr Tom | YES |
| Melville Mrs | YES | Y
| Jones Tom | YES | E
| Smith, Mrs | NO | S
MEL,%JON | Melvin,Mr Tom | YES | N
| Jones Tom | YES | O
^ - AND. The plus operand means 'AND' and is used to indicate if ALL search criteria is met e.g.
Search criteria | Field | Line | Match
-------------------|----------------------|----------|-----
MEL,^$TOM | Melvin,Mr Tom | YES |
| Jones Tom | YES | N
| Smith, Mrs | NO | O
MEL,^JON,^$AN | Melvin,Mr Tom | YES | Y
| Jones Tom | YES | E
| Smith, Mr Andrew | YES | S
!DEL,^!KILL | Deleted | YES | Y
| Killed | YES | E
| | | S
When using the '^' and '%' they only need to be entered once on
the line. If both are entered on the same line then only the last
one is used.
Multiple search criteria on more than one item
We have looked at entering one or more search criteria against a
single item. You can also enter search criteria for more than 1
item.
This is done in the same manner as individual lines, you specify beside each item what you want to search for. If you specify criteria for 2 items then BOTH lines must match before the record is selected, 3 items then all 3 lines must match etc.
Examples:
Field | Search criteria
----------------------|-----------------
Client type | =FC
Mileage | <=10
This will match any client with 'FC' under client type and with a
mileage of less than or equal to 10.
Field | Search criteria
----------------------|-----------------
Client type | =SA
Colour | Black (Note this will include
| Black/white etc.)
Weight | >10
Breed | =LABRADOR
The order in which they are specified does not make any
difference to execution speed. You can also specify multiple
search criteria on individual items.
Note: Dead animals should have DD in the status field, and marked animals have 1R, 2R, 3R, 4R in the status field.
Field | Search criteria
----------------------|-----------------
Client type | =SA
Species | CAN,FEL,CAT,DOG,K9,CANIS,MOGGY
| (Plus any other abbreviation your
| staff use for dogs and cats.)
Status field | <>DD,<>?R
Vacc. Int. | !=52
The combinations are endless and by using these examples you should have no problem in creating the required reports. In all the examples we have given so far we have been comparing selected fields with preset information. Search criteria can also be entered to compare one item with another e.g. you could find out whether stock quantity is lower than the minimum quantity. Rather than explain the method in this section it will be covered in the advanced section of this chapter.
Saving the report
The final step is to save the report. The final screen will be
displayed with two questions on it.
Report description - This is a brief description of what the report does. When you select a report to run or edit then this is the name that will be displayed. You have 20 characters available.
Filename to store under - This is name under which the details you have selected will be stored. If you press <RETURN> at this point a name will be allocated for you automatically. If you are entering a filename then it should be no longer than 8 characters following the filename conventions given in the operating system manuals. Do NOT enter any punctuation within the filename or any suffix if you are manually entering it.
| Top | Classic | New-Style | Chapters | Sections | Index | Search |