24 Jun 2024

Step 8: Create Queries - Sorting the customer’s record

1. Single click at Customers table
2.Click on the Create tab in the Ribbon.
3. Click on Query Design in the Queries group


4. The Show Table dialog box will appear.




5. Double-click the Customers table to add it to the query design grid.
  • Close the Show Table dialog box after adding the table.


6. Add Fields to the Query
  • Drag the Cust_ID field (or any other fields you want to include in your sorted list) from the table in the upper part of the query designer to the grid below.
  • Drag the Cust_Name field (or any other fields you want to include in your sorted list) from the table in the upper part of the query designer to the grid below.
  • Drag the City field (or any other fields you want to include in your sorted list) from the table in the upper part of the query designer to the grid below.
  • Drag the Quantity field (or any other fields you want to include in your sorted list) from the table in the upper part of the query designer to the grid below.
  • Drag the Price/unit field (or any other fields you want to include in your sorted list) from the table in the upper part of the query designer to the grid below.
  • Drag the ID_Manufacturer field (or any other fields you want to include in your sorted list) from the table in the upper part of the query designer to the grid below.


7. Save the Query
  • Name the query Customers_Ascend when prompted.
  • Click OK to save the query with this name.


8. Sort the Data
  • Set the Sort Order:
  • In the query grid, locate the Sort row under the Cust_Name column (or whichever column represents the customer names).
  • Click on the sort row and select Ascending from the dropdown list. This will set up the query to sort customer records by name in ascending order.


9. Run the Query to Verify the Results
  • Run the Query:
  • Click on the Run button (red exclamation mark) in the Design tab to execute the query and view the sorted records.

  • Or Simply Double click Customers_Ascend at Queries


10. Save the Query
  • After verifying that the records are sorted correctly, click on the Save button on the Quick Access Toolbar, or press Ctrl + S.
11. Close the Query
  • Close the query by clicking the Close button (X) on the query tab or right-clicking the query tab and selecting Close.

Tiada ulasan:

Catat Ulasan