【发布时间】:2010-02-12 00:40:40
【问题描述】:
我正在 Microsoft Access 中进行查询练习。我想将名字与传真号码连接起来.. 传真号码就像 (123)555-0103 .. 我正在这样做
select [first name] +' ''s Fax Number is' +str(fax number) as [Mariya`s Fax Number]
from employees where id =4;
但它给出了错误..
【问题讨论】:
-
请告诉我们它给出的错误
-
查询表达式'[first name] +' ''s Fax number is '+str(fax number)'中的语法错误(缺少运算符)。
-
Google for "access combine strings": techonthenet.com/access/functions/string/concat.php 它说:"string" & "another" 输出 "stringanother"
-
使用 & 连接运算符,您无需将传真号码强制转换为字符串数据类型。在 Jet/ACE SQL 和 VBA 中,+ 运算符为非数字数据传播 Null,但对数字执行加法。在 Access 中,默认情况下使用 & 进行连接,仅当您想要传播 Null 时才使用 + 进行连接(例如,Mid(("12"+LastName) & (", "+FirstName), 3) 以获得“Fenton ,大卫”的名字)。
标签: ms-access