WinVask -  Faktura

Overview: Filters Part 4

Overview: Filters Part 4

Previous topic Next topic  

Overview: Filters Part 4

Previous topic Next topic  

 

In part 3 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 their 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 sample situations 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 6 example filters above are very simple in structure but some interesting details quickly become apparent:

 

ð        The first 2 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 2 filters for Integer-type filters don't use a quote symbol; that would make them a text string!
ð        The last 2 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".

 

Continue the Filter tutorial