Introduction to Access 2010 CIS120first.accdb is the database I am creating.
I want you to use a different layout to design the table in the database.
I clicked on View and got prompted to name the table.
The first field is idno and I made the datatype text and the field size 5.
The second field is the empname and I made it text and changed the field size to 40.
The third field on the record is named jobcode and it is a text field that has a field size of 2 because the code is only 2 characters.
I have set up a forth field called numdep which I am going to make numeric and an integer. This shows the Data Type choices.
Once I pick Data type of Number I can chose a type depending on the numbers I want. I will use integer.
For decimal numbers I use single for small decimals and double for large decimals like salary. Now click on view and you can populating the table with data.
I have populated the table with data.
Now I click on Create. Next I click on Query Design. A query lets you specify fields and conditions that you want to use to access the table. It will return records that meet the query criteria.
Next I select the table by clicking on Add.
Now you see the fields in the table so you can select fields to use in your query.
I brought down four of the fields by double clicking on them (you can also drag). I want to see all IT employees so I put IT in the criteria line under the jobcode. Click on datasheet view to see results. IT is in quotes because it is a string or non-numeric literal.
Jobcode = IT YN Logic for query checking For jobcode = IT Display
Click on the design icon to go back to design.
I named the query ITemp.
The query has been saved
Creating another Query.
You can also click on the arrow and choose the field.
I have now got two conditions in an AND relationship. The two conditions are put on the criteria line and both must be true for the record to be displayed.
Jobcode = IT Salary < Display Y Y N N LOGIC for two things in an AND relationship
The results
In this example, the criteria is that numdep is > 3 OR salary is > Since these are in an OR relationship, one criteria goes on the criteria line and the other criteria goes on the or line.
numdep > 3 salary > Display YN Y N Logic for two criteria in an OR relationship.
The criteria is numdep > 3 OR salary > The first result has both true. The second result has just numdep > 3. The third result has just numdep > 3. The fourth result has just salary >
In this query the jobcode has to be IT and then in addition either the numdep has to be > 3 or the salary has to be > Since the IT has to be true it has to be on both the criteria line and the or line. Essentially you now have jobcode IT and numdep > 3 OR jobcode IT and salary >
Jobcode = IT numdep > 3 salary > Display YN Y N YN Jobcode has to be IT and then either numdep has to be > 3 OR salary has to be >
All the records have a jobcode of IT. The first record is IT and both numdep > 3 and salary > The second one is IT and jobcode > 3. The third one is IT and salary >