2012年计算机二级Access考前重点分析(4)
排序记录 一般情况下,在向表输入数据时,人们不会有意安排输入数据的先后顺序,而是只考虑输入的方便性,按照数据到来的先后顺序输入。例如,在登记学生选课成绩时,哪一个学生的成绩先出来,就先输入哪一个,这符合实际情况和习惯。但若要从这些杂乱的数据
排序记录
一般情况下,在向表输入数据时,人们不会有意安排输入数据的先后顺序,而是只考虑输入的方便性,按照数据到来的先后顺序输入。例如,在登记学生选课成绩时,哪一个学生的成绩先出来,就先输入哪一个,这符合实际情况和习惯。但若要从这些杂乱的数据中查找需要的数据就不方便了。为了提高?找效率,需要重新整理数据,对此最有效的方法是对数据进行排序。
1.排序规则
排序是根据当前表中的一个或多个字段的值对整个表中的所有记录进行重新排列。排序时可按升序,也可按降序。排序记录时,不同的字段类型,排序规则有所不同,具体规则如下:
(1)英文按字母顺序排序,大、小写视为相同,升序时按A到Z排列,降序时按Z到A排列。
(2)中文按拼音字母的顺序排序,升序时按A到Z排列,降序时按Z到A排列。
(3)数字按数字的大小排序,升序时从小到大排列,降序?从大到小排列。
(4)日期和时间字段,按日期的先后顺序排序,升序时按从前向后的顺序排列,降序时按从后向前的顺序排列。
排序时,要注意以下几点:
(1)对于文本型的字段,如果它的取值有数字,那么Access将数字视为字符串。因此,排序时是按照ASCII码值的大小排列,而不是按照数值本身的大小排列。如果希望按其数值大小排列,则应在较短的数字前面加零。例如,希望文本字符串“5”、“6”、“12”按升序排列,如果直接排列,那么排序的结果将是“12”、“5”、“6”,这是因为“1”的ASCII码小于“5”的ASCII码。要想实现所需要的升序顺序,应将3个字符串改为“05”、“06”、“12”。
(2)按升序排列字段时,如果字段的值为空值,则将包含空值的记录排列在列表中的第1条。
(3)数据类型为备注、超级链接或OLE对象的字段不能排序。
(4)排序后,排序次序将与表一起保存。
2.按一个字段排序
按一个字段排序记录,可以在“数据表”视图中进行。
例2.31 在“学生”表中,按“学生编号”升序排列。操作?骤如下:
(1)用“数据表”视图打开“学生”表,单击“学生编号”字段所在的列。
(2)单击工具栏中的“升序”按钮。
执行上述操作步骤后,就可以改变表中原有的排列次序,而变为新的次序。保存表时,将同时保存排序结果。
3.按多个字段排序
在Access中,不仅可以按一个字段排序记录,也可以按多个字段排序记录。按多个字段进行排序时,首先根据第一个字段按照指定的顺序进行排序,当第一个字段具有相同值时,再按照第二个字段进行排序,以此类推,直到按全部指定的字段排好序为止。按多个字段排序记录的方法有两种,一种是使用“数据表”视图实现排序,另一种是使用“筛选”窗口来完成排序。
例2.32 在“学生”表中按“性别”和“年龄”两个字段升序排序。使用“数据表”视图进行排序的操作?骤如下:
(1)用“数据表”视图打开“学生”表。选择用于排序的“性别”和“年龄”两个字段的字段选定器。
(2)单击工具栏中的“升序”按钮。
从结果可以看出,Access先按“性别”排序,在性别相同的情况下再按“年龄”从小到大排序。因此,按多个字段进行排序,必须注意字段的先后顺序。
若要取消对记录的排序,则将鼠标指向记录内容后单击鼠标右键,然后从打开的快捷菜单中选择“取消筛选排序”命令即可。
使用“数据表“视图按两个字段排序虽然简单,但它只能使所有字段都按同一种次序排序,而且这些字段必须相邻,如果希望两个字段按不同的次序排序,或者按两个不相邻的字段排序,就必须使用“筛选”窗口。
例2.33 在“学生”表中先按“性别”升序排列,再按“入校日期”降序排列。操作步骤如下:
(1)用“数据表”视图打开“学生”表。单击“记录”菜单中的“筛选”命令,然后从级联菜单中选择“高级筛选/排序”命令,打开“筛选”窗口 。
“筛选”窗口分为上、下两部分。上半部分显示了被打开表的字段列表。下半部分是设计网格,用来指定排序字段,排序方式和排序条件。
(2)用鼠标单击设计网格中第1列字段行右侧的向下箭头按钮,从打开的列表中选择“性别”字段,然后用同样的方法在第2列的字段行上选择“入校日期”字段。
(3)单击“性别”的“排序”单元格,单击右侧向下箭头按钮,并从打开的列表中选择“升序”;使用同样的方法在“入校日期”的“排序”单元格中选择“降序”
(4)单击工具栏上的“应用筛选”按钮,这时Access会按上面的设置排序“学生”表中的所有记录。
在指定排序次序以后,单击“记录”菜单中的“取消筛选/排序”命令,可以取消所设置的排序顺序。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



1. Open settings in Windows 11. You can use Win+I shortcut or any other method. 2. Go to the Apps section and click Apps & Features. 3. Find the application you want to prevent from running in the background. Click the three-dot button and select Advanced Options. 4. Find the [Background Application Permissions] section and select the desired value. By default, Windows 11 sets power optimization mode. It allows Windows to manage how applications work in the background. For example, once you enable battery saver mode to preserve battery, the system will automatically close all apps. 5. Select [Never] to prevent the application from running in the background. Please note that if you notice that the program is not sending you notifications, failing to update data, etc., you can

Are you getting "Unable to allow access to camera and microphone" when trying to use the app? Typically, you grant camera and microphone permissions to specific people on a need-to-provide basis. However, if you deny permission, the camera and microphone will not work and will display this error message instead. Solving this problem is very basic and you can do it in a minute or two. Fix 1 – Provide Camera, Microphone Permissions You can provide the necessary camera and microphone permissions directly in settings. Step 1 – Go to the Settings tab. Step 2 – Open the Privacy & Security panel. Step 3 – Turn on the “Camera” permission there. Step 4 – Inside, you will find a list of apps that have requested permission for your phone’s camera. Step 5 – Open the “Camera” of the specified app

DeepSeek cannot convert files directly to PDF. Depending on the file type, you can use different methods: Common documents (Word, Excel, PowerPoint): Use Microsoft Office, LibreOffice and other software to export as PDF. Image: Save as PDF using image viewer or image processing software. Web pages: Use the browser's "Print into PDF" function or the dedicated web page to PDF tool. Uncommon formats: Find the right converter and convert it to PDF. It is crucial to choose the right tools and develop a plan based on the actual situation.

In Java, a "field" is a data member in a class or interface that is used to store data or state. The properties of field include: type (can be any Java data type), access rights, static (belongs to a class rather than an instance), final (immutable) and transient (not serialized). Field is used to store state information of a class or interface, such as storing object data and maintaining object state.

Oracle can read dbf files through the following steps: create an external table and reference the dbf file; query the external table to retrieve data; import the data into the Oracle table.

The Java reflection mechanism allows programs to dynamically modify the behavior of classes without modifying the source code. By operating the Class object, you can create instances through newInstance(), modify private field values, call private methods, etc. Reflection should be used with caution, however, as it can cause unexpected behavior and security issues, and has a performance overhead.

Common exception types and their repair measures in Java function development During the development of Java functions, various exceptions may be encountered, which affect the correct execution of the function. The following are common exception types and their repair measures: 1. NullPointerException Description: Thrown when accessing an object that has not been initialized. Fix: Make sure you check the object for non-null before using it. Sample code: try{Stringname=null;System.out.println(name.length());}catch(NullPointerExceptione){

Ways to solve iframe cross-domain issues in Vue: CORS: Enable CORS support in the backend server and use XMLHttpRequest or fetch API to send CORS requests in Vue. JSONP: Dynamically load JSONP scripts in Vue using the JSONP endpoint in the backend server. Proxy server: Set up a proxy server to forward requests, use a third-party library (such as axios) in Vue to send requests and set the proxy server URL.
