6. MICROSOFT ACCESS QUERIES – ADVANCED

6.1.3: Not

The NOT logical operator negates a logical expression.

 

Example

To get a list of 3-credit hour courses we would use a criteria of 3, but to list courses that are not 3 credit hours one could use the criteria: NOT 3, which, written in long form is:

NOT (creditHours = 3)

Coding this in QBE we have:

image
                                           Figure 6.3: Using NOT

Exercises

Write queries to:

1) List all courses in Mathematics and Statistics.

 

2) List all courses in Mathematics and Statistics where the credit hours are greater than 1.

 

3) Lists the titles of courses offered by the Chemistry and Physics departments that are not full courses (that is, they are not 6 credit hour courses).

  • Once this query is coded, close and reopen your query. You may see that MS Access converts your “Not 6” expression to another alternate form, “< > 6”, where the combination < > stands for not equal to.

 

4) List all 3 and 6 credit hour courses that are not ACS courses.

License

Share This Book