In and Between Queries


Queries let you select records which answer a particular question. Most simple queries use an equals sign in the criterion to find all records matching a certain value. The "In" and "Between" expressions give you more flexibility.

In

For example you could use an "In" expression to find customers in the UK, France, and Germany:

[

You could of course have written this on three lines of the grid as "=UK", "=Germany" and "=France" but the shorter form saves typing.

The criterion can be inverted as "Not In(UK, France, Germany)" to give customers outside these countries.

SubQueries takes this concept one stage further but you do need to know a little SQL to be able to use them.

Between

The meaning or "Between" is probably obvious, it gives you the records which lie between two values. For example:

[

There is a subtle problem with this example. It will give you all the countries between "A" and "G" but it won't give you "Germany" because that lies after "G" in the alphabet. If you wanted to get all the countries beginning with "G" then change the criterion to Between "A" and "Gz".


Hints & tips

The textbox class in Visual FoxPro 9 has a new Autocomplete property which shows the user the previous values that have been entered in that textbox.
Autocomplete in VFP 9

Your Access database will look more impressive if you add custom toolbars...
Custom toolbars

FoxPro has always had functions to read and write files at a low level...
Foxpro low level file functions

More...
More pages of hints and tips for users of Microsoft FoxPro and Access databases.

Site Map