Part I: Access Building Blocks
206
FIGURE 5.14
Using the Between...And operator. The results are the same as the query in Figure 5.13.
The operands for the Between...And operator are inclusive. This means that sales on 10/1/2012
and 3/31/2013 are included in the query results.
Searching for Null data
A field might have no contents for several reasons: For example, perhaps the value wasn’t known
at the time of data entry, or the person who did the data entry simply forgot to enter the informa-
tion, or the field’s information was removed. Access does nothing with this field. Unless a default
value is specified in the table design, the field simply remains empty. (A field is said to be null
when it’s truly empty.)
Databases must work with all kinds of information. We’re all familiar with text, numeric, date, and
other types of data, and in most cases, the value is known. For example, we almost certainly know a
new employee’s first and last name, but we may not yet know their middle name. How does a database
represent a value that is unknown, and which may, in fact, not exist? That’s where null comes in. By
default, most fields in a database table are null until a value is provided. The value may come from a
user entering a value on a form, or may be provided through the field’s default value property. If we
learn the employee does not have a middle name, we may enter an empty string (““) in the field hold-
ing the middle name. In this case, an empty string means that there is no middle name. But, as long as
the value is unknown, the field is null.
What is a null value?