Home

Microsoft Access Data Analysis: Conjunction

 

Logical conjunction is performed using the AND operator. Besides the SELECT statement, the formula to use is:

WHERE Expression1 AND Expression2

The WHERE and the AND keywords are required. Each expression is in the form:

FieldName Operator Value

 You must specify a column, an operator, and a value. Here is an example:

SELECT 	Properties1.[Property #], 
	Properties1.[Property Type], 
	Properties1.City, Properties1.Bedrooms, 
	Properties1.Bathrooms, 
	Properties1.[Year Built], 
	Properties1.Condition, 
	Properties1.[Market Value]
FROM 	Properties1
WHERE 	(((Properties1.City)="Silver Spring") AND 
	 ((Properties1.[Market Value])<=500000));

Here is another example: 

SELECT 	Properties1.[Property #], 
	Properties1.[Property Type],
	Properties1.City, 
	Properties1.State, 
	Properties1.[ZIP Code], 
	Properties1.Bedrooms, 
	Properties1.Bathrooms, 
	Properties1.Stories, 
	Properties1.[Year Built], 
	Properties1.Condition, 
	Properties1.[Market Value]
FROM 	Properties1
WHERE 	(((Properties1.[ZIP Code]) Between 20850 And 20920));

Here is another example: 

SELECT 	Properties1.[Property #], 
	Properties1.[Property Type], 
	Properties1.City, 
	Properties1.State, 
	Properties1.[ZIP Code], 
	Properties1.Bedrooms, 
	Properties1.Bathrooms, 
	Properties1.Stories, 
	Properties1.[Year Built], 
	Properties1.Condition, 
	Properties1.[Market Value]
FROM 	Properties1
WHERE 	(((Properties1.[Property Type])="single family") AND 
	 ((Properties1.[ZIP Code]) Between 20850 And 20920)) OR 
	 (((Properties1.[Property Type])="townhouse"));

Here one more example: 

SELECT 	Properties1.[Property #], 
	Properties1.[Property Type], 
	Properties1.City, 
	Properties1.State, 
	Properties1.[ZIP Code], 
	Properties1.Bedrooms, 
	Properties1.Bathrooms, 
	Properties1.Stories, 
	Properties1.[Year Built], 
	Properties1.Condition, 
	Properties1.[Market Value]
FROM 	Properties1
WHERE 	((Properties1.[Property Type] = "single family") OR 
	 (Properties1.[Property Type] = "townhouse")) AND 
	 (Properties1.[ZIP Code] Between 20850 And 20920);
 
 

Home Copyright © 2008-2009 FunctionX, Inc.