CN (Citizenship
Number)
|
Name
|
Gender
|
DOB
|
Address
|
Solution:
a) To create a database and make a table.
Step 1:- Start Ms Access app.
Step 2:- Rename the database as 'AgeDBMS'.
Step 3:- Click Create.
Step 4:- Edit the ID field name to CN.
Step 5:- To add more fields to a table in Datasheet view, double-click the Add New Field header.
Step 6:- Next, we've added the fields Name, Gender, DOB and Address to the salary table.
Step 7:- Press Ctrl + s to save the table name as 'Candidate_INFO'.
Step 8:- Insert suitable 4 records in table and again save the record of table.
b) To create a required queryfor the calculation of Age of Candidate.
Step 1:- Select the Create tab. Then click on the Query Design button under the Other group.
Step 2:- Next, highlight the Candidate_INFO table and clicked on the Add button. When you are done selecting the tables, click on the Close button.
Step 3:- In the first field,
type Age: DateDiff("yyyy",[DOB],Now())+Int(Format(Now(),"mmdd")<Format([DOB],"mmdd"))
Step 4:- Add the other fields to the query. You can do this by double-clicking on the field name of the table. In this example, we've added the Name and Address.
Step 5:- Then click on the Save button at the top left of the window.
Step 6:- The Save As window should appear. Enter the name 'Query1' and click on the OK button.
Step 7:- Run Query to view Result.
-That's all the steps.
No comments:
Post a Comment