返回一个包含指定字符串(已转换为大写形式)的 Variant (String) 值。
语法
UCase (字符串)
必需的字符串参数是任何有效的字符串表达式。 如果 字符串 包含 Null,则返回 Null 。
备注
只有小写字母转换为大写;所有大写字母和非字母字符保持不变。
查询示例
| Expression | 结果 |
|---|---|
| SELECT Ucase (ProductDesc) AS Upper_ProductDesc FROM ProductSales; | 将 “ProductDesc” 字段中的值转换为大写,并显示在列 Upper_ProductDesc 中。 |
VBA 示例
注意
下面的示例演示了在Visual Basic for Applications (VBA) 模块中使用此函数。 有关使用 VBA 的详细信息,请在“搜索”旁边的下拉列表中选择“开发人员参考”,然后在搜索框中输入一个或多个术语。
此示例使用 UCase 函数返回字符串的大写版本。
Dim LowerCase, UpperCase
LowerCase = "Hello World 1234" ' String to convert.
UpperCase = UCase(LowerCase)
' Returns "HELLO WORLD 1234".