In part 2, some simple filters were shown to help you understand the components of a database filter. A database filter can be very simple, or fairly complex - it depends on the type of report that you are attempting to create.
In it's most simple form database filters can be used for three different situations:
|•||You are extracting information based on text|
|•||You are extracting information using numbers|
|•||You are extracting information based on a logical condition|
Here are some situation descriptions and a simple database filter for each:
Customers who drive a BMW
CUS:CarType = 'bmw'
Products made by MierWater
ITM:Company = 'mierwater'
Items with an onhand quantity greater than 20
ITM:QtyOnhand > 20
Children who are too young to be in Kindergarten
Nam:Age < 7
Customers who have pets
NAM:Pets = 1
Items with no detailed information available
ITM:Detailed = 0
The six example filters above are very simple in structure, but some interesting details quickly become apparent:
|•||The first two filters for Text-type filters require a quote symbol (') before and after the text string that you are comparing against the database field|
|•||The next two filters for Integer-type filters don't use a quote symbol; that would make them a text string!|
The last two filters for Logical-type filters use either a 0 (False) or 1 (True) to indicate true or false. This is because the information for this database field is stored as a one position integer in the database. For those of you with dBase experience this is quite different than what you are used to. dBase stores a value of true as "Y" or "T", and a negative value as "N" or "F".