Current location - Training Enrollment Network - Books and materials - How to query the total number of days for students to borrow books in access (borrowing days =
How to query the total number of days for students to borrow books in access (borrowing days =
Step 1: Click the query object in the database window, click the New button, select the design view, click the OK button, add departments, students and borrowing tables, and then click the Close button;

Step 2: drag the student number field in the student table to the student number field in the borrowing table for release, and drag the staff code field in the staff table to the corresponding field in the student table for release, thus establishing the connection among the three tables;

Step 3: Drag the fields of teacher code, teacher's name, borrowing date and return date to the field row, add another field "Days: [Return Date]-[Borrowing Date] (colon is entered in English), and set the borrowing date and return date fields to not be displayed;

Step 4: Click the "Total" button in the toolbar, and in the newly added "Total" line, set the borrowing date, return date and days: [Return date]-[Borrowing date] as "Total", and set the fields of "Faculty Code" and "Faculty Name" as "Grouping";

Step 5: Click the Save button on the toolbar, enter the query name "CX2" in the pop-up dialog box and close the query window;

answer

Step 1: Click the Close button in the database window to save the database Test. MDB”。